search for: penyiwang

Displaying 12 results from an estimated 12 matches for "penyiwang".

2020 Mar 13
3
Why MachineBasicBlcok doesn't have transferPredecessors() ?
...later one as the original one. (to keep the label/Blackadder's correct t) (or keep other property of mbb) so I need to transfer the original mbb's predecessor to the new mbb. Nicolai Hähnle <nhaehnle at gmail.com> 於 2020年3月13日 週五 23:57 寫道: > On Fri, Mar 13, 2020 at 12:22 PM PenYiWang via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > I found that there is transferSuccessors() in MachineBasicBlcok > > > > So that when manipulating MachineBasicBlock, > > we can use transferSuccessors to update the CFG easily. > > > > Why there is n...
2020 Jun 18
2
How to know the CallInst is a virtual call ?
...whether a CallInst is a C++ virtual call or not. I have to get the information at frontend/Clang. and then pass the information to middle-end/LLVM IR by myself. Is it right? Thank you David Blaikie <dblaikie at gmail.com> 於 2020年6月19日 週五 上午1:26寫道: > On Thu, Jun 18, 2020 at 9:53 AM PenYiWang via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > > > Hi > > > > I know that a virtual call looks like this : > > > > %4 = load %class.base*, %class.base** %1, align 8 > > %5 = bitcast %class.base* %4 to void (%class.base*)*** > >...
2018 Aug 09
3
Replace "ret" with "pop+jump"
Hi I want to replace all the return instructions in the program with pop <reg>; jmp <reg>. Should I use IRBuilder in LLVM IR level? I found that there is a IRBuilder::CreateIndirectBr Or Should I modify the code in lib/Target/X86/X86ISelLowering.cpp in backend ? I found that there is a X86TargetLowering::LowerCall Which is better? Thanks -------------- next part --------------
2020 Feb 25
2
How to print all pass when using -flto floag ?
Hi We knew that "clang -mllvm -debug-pass=Structure ..." can print all pass' name. But, when we use LTO , -flto flag and gold plugin. I found that the option " -debug-pass=Structure" would not pass to ld. so it would not print all the LTO pass's name. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2020 Mar 13
2
Why MachineBasicBlcok doesn't have transferPredecessors() ?
Hi I want to ask a question. (Maybe it is a trivial question.) I found that there is transferSuccessors() in MachineBasicBlcok So that when manipulating MachineBasicBlock, we can use transferSuccessors to update the CFG easily. Why there is not transferPredecessors in MachineBasicBlcok ? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL:
2020 Jun 18
2
How to know the CallInst is a virtual call ?
Hi I know that a virtual call looks like this : %4 = load %class.base*, %class.base** %1, align 8 %5 = bitcast %class.base* %4 to void (%class.base*)*** %6 = load void (%class.base*)**, void (%class.base*)*** %5, align 8 %7 = getelementptr inbounds void (%class.base*)*, void (%class.base*)** %6, i64 0 %8 = load void (%class.base*)*, void (%class.base*)** %7, align 8 call void
2020 Mar 09
2
How to make when developing machine function pass ?
Hi I am modifying X86RetpolineThunks.cpp. X86RetpolineThunks.cpp 's location is llvm-src/lib/Target/X86. Which target should I use , next time use clang test.c , I can see the difference . I found that "make llc" doesn't work. And either "make LLVMX86CodeGen" doen't work. "make clang" waste a lot of time, even -j64. Every time modifying the file
2018 Sep 05
3
How to get return address at llvm ir level?
Hi I want to write a FunctionPass to insert some code before return. Funcion: .. .. .. mov eax,[esp] cmp eax,0x12345678 je 0x12345678 ret (maybe stack will not balance) I wonder that can I get the return address at llvm ir level? I use IRBuilder to CreateICmpEQ and CreateCondBr. but I don't how to get the value of return addrss. I have found there is a Intrinsic::returnaddress. Is
2020 Mar 13
2
How to simply split MachineBasicBlock ?
Hi I am developing some machine function pass. I want to split MachineBasicBlcok when I find some specific machine instruction. But I don't insert or delete any machine instruction. I just "simply" , "purely" split the MachineBasicBlcok. (So, I stole the idea from ARM64BranchRelaxation::splitBlockBeforeInstr.) This is my code : // I would pass call instruction to
2020 Feb 27
3
How to set DebugLoc when using IRBuilder's CreateCall ?
Hi I want to insert some functions into the llvm bitcode ir files. So I use IRBuilder and CreateCall(). But it how error : inlinable function call in a function with debug info must have a !dbg location. I don't know what DebugLoc should I give the new CallInst to setDebugLoc. I Create this CallInst , so this CallInst doesn't hava so-called "DebugLoc" mapping to the source
2020 Feb 28
2
Is BlockAddress always correct ?
Hi I use BlockAddress to get the address of BasicBlock , and I use GlobalVariable 's getInitializer() to pass the address of BasicBlock to the global variable of my own program and then I print it out. But , I found that BlockAddress is not always correct. For example, some function's rsp (stack pointer) or other register is maintained by caller, so it would be like:
2019 Sep 30
3
Debugging LowerTypeTests in LLVM Using GDB
Hi, I am looking into Control-Flow Integrity for indirect function calls, implemented with jump tables. I want to step through the code that produces these jump tables in GDB. I have built clang and opt from source with debugging symbols. I believe this code lives in llvm/lib/Transforms/LowerTypeTests.cpp, but when I try to debug *opt* by running the command "run -lowertypetests cfi-icall.bc