search for: printasoperand

Displaying 6 results from an estimated 6 matches for "printasoperand".

2019 Apr 23
5
StringRef Iterator Variable Display
Hello, I want to display the variable names in stringref iterator. But it is not displayed using following code. for (set<StringRef>::iterator sit = L.begin(); sit != L.end(); sit++) { errs() << *sit << " "; } How to do this? Please help.. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2019 Oct 23
2
Inserting instructions when encountered a specific label
...nds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0)) br label %end end: %end1 = load i32, i32* %3, align 4 ret i32 %end1 } I want to insert a new instruction when I encounter the true, false, and end labels (inside their respective blocks). I tried to detect the label names using " I.printAsOperand(errs(), false);” when parsing the instructions in SelectionDAGBuilder but it was only visiting instructions in the first/main BB and outputted %2. Which pass or phase would be the best to see if the current block’s label matches “true”, “false”, or “end” and insert an instruction inside that block?...
2019 Oct 23
3
Inserting instructions when encountered a specific label
...B and outputted %2. I'm not sure what's going on there, it would depend on which function you're modifying in SelectionDAG. I am calling it right after each instruction is visited in the visit(…) function. And it prints out the instruction’s number but it prints out only %2 when I call printAsOperand on the instruction’s parent, hence why I assumed that the visit function was going over only the main block. It's probably easier if it's before SelectionDAGBulder (or at the very beginning of its runOnFunction) so you can modify the IR without worrying about whether SelectionDAG will noti...
2018 Dec 12
2
How to get the destination in a LoadInst
Thanks Joshua and Michael, Just to to clarify, I'm experimenting with the Interpreter class and observing the instructions that are executed by it. Just for becoming more confident with LLVM in general I'd like for each instruction to access to the various parts of it. In this instance I would like to access to the %Name that is shown in the textual representation. When I call
2016 Oct 29
1
Problems with Inline ASM expressions generated in the back end
...m::Module const*, bool) /llvm/lib/IR/AsmWriter.cpp:2045:0 #11 0x00007f50bc680e2c printMetadataImpl(llvm::raw_ostream&, llvm::Metadata const&, llvm::ModuleSlotTracker&, llvm::Module const*, bool) /llvm/lib/IR/AsmWriter.cpp:3504:0 #12 0x00007f50bc680fcc llvm::Metadata::printAsOperand(llvm::raw_ostream&, llvm::ModuleSlotTracker&, llvm::Module const*) const /llvm/lib/IR/AsmWriter.cpp:3520:0 #13 0x00007f50bd2ee8e2 llvm::MachineOperand::print(llvm::raw_ostream&, llvm::ModuleSlotTracker&, llvm::TargetRegisterInfo const*) const /llvm/lib/CodeGen/MachineIns...
2018 Apr 07
1
Print emory for constant address
Hi all, Consider a simple ll code: %2 = load i32* %y, align 4 I intend to get the memory address of %2. if(isa<loadInst>(I)){ // variable name:y value v = I.getOperand(0); // ? I shows the entire instruction, not %2, then I.getName() would print an empty space which is %2, but I can’t get the memory when dereferencing it errs()<< *&(I.getName())<<"\n”; } error: