similar to: [LLVMdev] llvm 'select' instruction

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] llvm 'select' instruction"

2013 Apr 14
0
[LLVMdev] llvm 'select' instruction
Hi Dong, try turning optimizations on. I get the select then: > └─[$]› echo 'int min(int a, int b) { return a < b ? a : b; }' | clang -xc -O1 -S -emit-llvm -o - - > ; ModuleID = '-' > target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" >
2013 Apr 14
0
[LLVMdev] llvm 'select' instruction
Something like this should do the job (taken from a test file from the libbeauty decompiler project): /* A very simple jump table. */ int test58(int var1) { int n = 0; switch (var1) { case 1: n = 1; break; case 2: n = 2; break; case 3: n = 3; break; case
2013 Apr 14
0
[LLVMdev] llvm 'select' instruction
On 04/14/2013 02:17 PM, Dong Chen wrote: > hello guys: > i am thinking about what kind of C instructions can turn into llvm IR > 'select' instruction. > i tried "d=a?b:c" and compiled it using clang, i still didn't get 'select' > is there anybody who knows this? > thank you Did you try to compile this with optimization enabled? (at least -O1) For
2013 Apr 14
1
[LLVMdev] llvm 'select' instruction
hi Sam: thank you for your reply. but i have another question about this 'select' instruction. i think that in LLVM IR, i can use a branch and two seperate assignments to replace 'select' instruction(am i right?). so is there any compiling option to aviod generate 'select' instruction? -- View this message in context:
2013 Apr 14
0
[LLVMdev] llvm 'select' instruction
Hi, If you run the simplify-cfg pass, select instructions should get generated. Regards, Sam On 14/04/2013 14:17, Dong Chen wrote: > hello guys: > i am thinking about what kind of C instructions can turn into llvm IR > 'select' instruction. > i tried "d=a?b:c" and compiled it using clang, i still didn't get 'select' > is there anybody who knows this?
2013 Apr 14
1
[LLVMdev] llvm 'select' instruction
hi Clemens Hammacher: thank you for your helpful answer. but i have another question about this 'select' instruction. i think that in LLVM IR, i can use a branch and two seperate assignments to replace 'select' instruction(am i right?). so is there any compiling option to aviod generate 'select' instruction? -- View this message in context:
2012 Dec 05
4
[LLVMdev] how to get and modify a global variable inside a module
recently, i use LLVM API to write a program to read *.ll and excute it automatically. Further more, i want to change some global variables inside a module. i tried some functions provided by Module.h and ExecutionEngine.h but none were seemed to match my need. did someone have the experience or some advices? thank you ;) -- View this message in context:
2012 Dec 05
3
[LLVMdev] how to get and modify a global variable inside a module
hi Duncan Sands, i have tried the functions: GlobalValue * getNamedValue (StringRef Name) const GlobalVariable * getGlobalVariable (StringRef Name, bool AllowInternal=false) const GlobalVariable * getNamedGlobal (StringRef Name) const but i think these functions just return the ID or something else (not the Global Variable's main memory address, i am not sure) here is the thing. i
2012 Dec 05
2
[LLVMdev] how to get and modify a global variable inside a module
hi Eduardo, thanks for your attention, i checked the iterator, but i didn't see any fucntion can return or modify the main memory address of a global variable inside the module. can you provide some reference code or program can achieve this? thank you very much -- View this message in context:
2013 Apr 14
2
[LLVMdev] is there any passes or compiling options that can aviod to generate vector instructions and 'select' instruction in IR
hi guys: is there any passes or compiling options that can aviod to generate vector instructions and 'select' instruction in IR. i think that these instructions can be replaced with other instructions in LLVM IR. So if there is a way to eliminate these instructions during compilation? -- View this message in context:
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
On 12/5/12 2:49 PM, Dong Chen wrote: > here is the thing. i want to know the exact main memory address of the > Global Varibale's address when ExecutionEngine execut the *.ll code. further > more, i want to change the address, is it possible? I assume you want to adjust the value at that address, right? Then you might want to check the ExecutionEngine::getPointerToGlobal method. You
2013 Apr 09
2
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hi, Duncan: thanks for your patience. i have tried it. using instuction: errs()<<i->getOperand(0); but it prints the address: someting like 0x1139700; i checked the defination of getOperand() is Value* getOperand( unsigned int i); so is there someting i missed? -- View this message in context:
2013 Apr 09
3
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hi, Duncan, thank you for your reply; instruction "i->getOperand(0)->dump()" may print the %4 in the screen, but how can i store it in a variable like char * oprand="%4" ? -- View this message in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572p56588.html Sent from the LLVM - Dev mailing
2013 Apr 09
2
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hello guys: I am in trouble with get the identifies of the unnamed temporaries from the instruction of LLVM IR. for example: instruction: %4 = mul nsw i32 %1, %width unnamed temporaries: %4, %1 how to get them? I have tried several iterators(op_iterator,value_op_iterator) and getOperand(int) function,but none of them works. does anyone know how to get it? thanks very much -- View this message
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello guys, recently, i successfully get and modify global variable by execution engine. the functions i used are listed here: int m=1; EE->updateGlobalMapping(p->M->getGlobalVariable("x",true),&m); EE->recompileAndRelinkFunction(EntryFn); x is the global variable in the module. but how to modify the local variable in the module? -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hello Óscar Fuentes, thanks for your reply, if i use the API provided by parser.h and the program *.ll i parsed contains local variable, i can get a module have local variable without defines it first. i think that module is a structure like AST(i am not sure whether i was right), this must be a traversal method. am i right or do i misunderstand something? -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes, i am new to llvm, so i still have several questions. thanks for you help. (1)what is SSA form(static single assignment)? (2)how to traverse the basic blocks? if the module is gained by parser, what will the basic blocks contain? i will be on the line, thank you very much -- View this message in context:
2012 Dec 10
2
[LLVMdev] how to get and modify a local variable's value through executionEngine?
hi Óscar Fuentes , thanks for your reply, but there are still a lot of concepts i don't understand. there seems to be some document to guide you but hard to understand. can you show me some basic and easy to learn document or websites? thank you -- View this message in context:
2012 Dec 12
2
[LLVMdev] donot support uint datatype?
hi guys, i use clang to compile a program with datatype uint, but i get errors saying " use of undeclared identifier 'uint'; did you mean 'int'? ". it really doesn't support it? if true, how can i add a datatype? -- View this message in context: http://llvm.1065342.n5.nabble.com/donot-support-uint-datatype-tp52523.html Sent from the LLVM - Dev mailing list archive
2012 Dec 12
2
[LLVMdev] donot support uint datatype?
hi Wei-Ren, i got it, i have to add a "typedef int uint;" that's not a big problem thank you -- View this message in context: http://llvm.1065342.n5.nabble.com/donot-support-uint-datatype-tp52523p52528.html Sent from the LLVM - Dev mailing list archive at Nabble.com.