Dong Chen
2013-Apr-09 08:16 UTC
[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 in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Duncan Sands
2013-Apr-09 08:47 UTC
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
Hi, On 09/04/13 10:16, Dong Chen wrote:> hello guys: > I am in trouble with get the identifies of the unnamed temporaries from the > instruction of LLVM IR.this is a FAQ. Most names in the IR are just there to make it easier to read and can safely be removed. You can't rely on instructions having names, and as you saw often they do not have a name. Even if they start off with a name, the optimizers may change the name, eg when inlining.> for example: > instruction: %4 = mul nsw i32 %1, %width > unnamed temporaries: %4, %1These are not temporaries, they are values without a name. The numbers %4 and %1 only exist in the human readable IR (.ll file), as without them it wouldn't be possible to convert the human readable IR back into bitcode. You can't get hold of them from the API since they don't exist.> 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 muchWhy do you want them? Maybe you are really looking for debug info? Ciao, Duncan.> > > > -- > View this message in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572.html > Sent from the LLVM - Dev mailing list archive at Nabble.com. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Dong Chen
2013-Apr-09 09:19 UTC
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hi, Duncan Sands: thanks for your reply old friend. the reason why I want to get the unnamed value is that I am doing some analysis based on the IR code. And IR is in the form of SSA(static single assignment). so i need to get the operands of each instructions including a lot of instructions like this (%4 = mul nsw i32 %1, %width). the unnamed values are the connection of instructions, if i can't get that, how can i know the dependency of the instructions? -- View this message in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572p56577.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Possibly Parallel Threads
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR