similar to: How to get return address at llvm ir level?

Displaying 20 results from an estimated 300 matches similar to: "How to get return address at llvm ir level?"

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
2011 Jul 26
4
[LLVMdev] How to get the return address on the stack on LLVM
Hi all, I want to implement the Xor random canary, so I have to get the return address in the prologue and epilogue of the function. In the prologue of the function, before I insert into the canary on the stack, I can get the return address by: ConstantInt* ci = llvm::ConstantInt::get(Type::getInt32Ty(RI->getContext()), 0); Value* Args1[] = {ci}; CallInst* callInst =
2017 Apr 17
2
[RFC] Adding CPS call support
(Sorry for the 2nd email Eli, I forgot to reply-all). > I'm not following how explicitly representing the return address of a call in the IR before isel actually solves any relevant issue. We already pass the return address implicitly as an argument to every call; you can retrieve it with llvm.returnaddress if you need it. Unfortunately the @llvm.returnaddress intrinsic does not solve
2011 Jul 31
1
[LLVMdev] Help !! Problem about Intrinsic::returnaddress and optimization
Hi all, I want to add some functionalities to Stack protection of llvm by modifying the file StackPrtoector.cpp under llvm/src/lib/CodeGen. However, I encounter some problems here. Here is my problem: I want to call the function Intrinsic::returnaddress with the same parameter twice in a function. However, llvm will optimize this process automatically by storing the result from the first call
2011 Aug 03
1
[LLVMdev] Help !! Problem about Intrinsic::returnaddress and optimization
Hi all, I want to add some functionalities to Stack protection of llvm by modifying the file StackPrtoector.cpp under llvm/src/lib/CodeGen. However, I encounter some problems here. Here is my problem: I want to call the function Intrinsic::returnaddress with the same parameter twice in a function. However, llvm will optimize this process automatically by storing the result from the first call
2011 Jul 26
0
[LLVMdev] How to get the return address on the stack on LLVM
On 7/26/11 5:37 PM, Xueying ZHANG wrote: > Hi John, > > Thanks for your reply! I'm CC'ing this to the list in case anyone knows why you're seeing this behavior. > > Now, I know the different between llvm.returnaddress(0) and > llvm.returnaddress(1). I modify the StackPortector.cpp and I just want > to get value of the return address stored on the stack. >
2020 Mar 13
3
Why MachineBasicBlcok doesn't have transferPredecessors() ?
for example I want to insert a new machine bb “before” a specific machine bb. or split a mbb and keep the 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
2019 Jan 23
3
option similar to -finstrument-functions but for code blocks
Hi, I'd like to track not just at the function level, but also at the code block level. For example, for a if-else statement, I want to know when the if-branch or else-branch is enter/exit. Is there a clang option similar to -finstrument-functions for code blocks? Alternatively, I could manually insert the code to the IR .ll file. I see the generated .ll use the following function when
2018 Sep 05
2
How to get return address at llvm ir level?
To my knowledge that intrinsic IS generated by frontends like Clang when using _builtin_return_address(), i could be wrong though Zhang > 在 2018年9月5日,10:47,Bekket McClane via llvm-dev <llvm-dev at lists.llvm.org> 写道: > > and
2020 Jun 18
2
How to know the CallInst is a virtual call ?
So if I want to know 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: > >
2004 Oct 25
2
[LLVMdev] Some question on LLVM design
Misha Brukman wrote: > >>1. Opcodes and intrinsics >> > That's not really correct. The intrinsics such as llvm.frameaddress and > llvm.returnaddress have no equivalents in LLVM opcodes -- the meaning of > the intrinsics is specifically machine-dependent, and LLVM (and its > opcodes) are machine-independent, so there is no valid interchange of > these intrinsics
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 --------------
2019 Jul 03
2
optimisation issue in an llvm IR pass
Hello, I have an optimisation issue in an llvm IR pass - the issue being that unnecessary instructions are generated in the final assembly (with -O3). I want to create the following assembly snippet: mov dl,BYTE PTR [rsi+rdi*1] add dl,0x1 adc dl,0x0 mov BYTE PTR [rsi+rdi*1],dl however what is created is (variant #1): mov dl,BYTE PTR [rsi+rdx*1] add dl,0x1 cmp
2015 Dec 01
10
[RFC] Intrinsic naming convention (words with dots)
Hi everyone, We seem to have allowed our documented target-independent intrinsics to acquire a somewhat-haphazard naming system, and I think we should standardize on one convention. All of the intrinsics have 'llvm.' as a prefix, and some also have some additional prefix 'llvm.dbg.', 'llvm.eh.', 'llvm.experimental.', etc., but after that we lose consistency. When
2019 Jul 03
3
optimisation issue in an llvm IR pass
Hi Craig, On 03.07.19 17:33, Craig Topper wrote: > Don't the CreateICmp calls return a Value* with an i1 type? But then > they are added to an i8 type? Not sure that works.  I had that initially: auto cf = IRB.CreateICmpULT(Incr, ConstantInt::get(Int8Ty, 1)); auto carry = IRB.CreateZExt(cf, Int8Ty); Incr = IRB.CreateAdd(Incr, carry); it makes no difference to the generated assembly
2011 Jul 01
0
[LLVMdev] LLVM and managed languages
Hi Talin, I have some questions below. If these topics have already been discussed in earlier threads, kindly point me there. I'm aware of your GC proposal, but the rest is new to me. On Jul 1, 2011, at 11:05 AM, Talin wrote: > Garbage collection is still way too difficult. The biggest problem is the inability to track SSA values - it requires the frontend to generate very inefficient and
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:
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
Hi All, I'm writing a code generation with my compiler. I read sever example and documentation but I did understand what I make wrong. What I try to do is a compare a local variable with a constant. But when I create a ICMP instruction I get that instruction are not of same type. I'm using llvm by svn repository updated at two week ago. The code that I try to generation is something
2008 Aug 07
1
Expire Plugin - LDA with Vpopmail errors
I am trying to setup Dovecot to use the expire plugin and wanted to use the LDA so I can ensure the messages are indexed as they are delivered to the mailboxes. This system is only accessed via a webmail interface Using dovecot-1.1.2 and Vpopmail with Qmail Dovecot.conf file base_dir = /usr/local/var/run/dovecot/ protocols = imap disable_plaintext_auth = no shutdown_clients = yes log_path =