similar to: [LLVMdev] Which pass converts call printf to puts?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Which pass converts call printf to puts?"

2012 Jun 18
0
[LLVMdev] Which pass converts call printf to puts?
Hi Thomson, the new call to puts() is inserted right away, whereas the old call to printf() is removed a bit later in SimplifyLibCalls::runOnFunction(). If you browse the code a bit and backtrack the call stack to see what happens with the return value of PrintFOpt::OptimizeFixedFormatString(), you will stumble upon this segment in SimplifyLibCalls.cpp:1703ff.: // Try to optimize this call.
2012 Jun 18
2
[LLVMdev] Which pass converts call printf to puts?
Ok. So it seems CI->eraseFromParent() removed the old instruction and the new one is inserted right after this one in the inner function in the case of printf->puts. There is another line CI->repalceAllUsesWith(Result). I think this line could also do the replacement besides inserting the new one in the inner function. What's the difference of these 2 replacement methods? Also
2012 Jun 18
1
[LLVMdev] Which pass converts call printf to puts?
This makes sense now. So if the instruction doesn't make any assignment, it would be unnecessary to replace any operand reference and the same instruction(CI) would be returned from the inner function to avoid this replacement, is this right? Thanks, -Thomson On Mon, Jun 18, 2012 at 8:09 PM, Christoph Erhardt <christoph at sicherha.de>wrote: > Hi Thomson, > > > Could you
2013 Feb 19
5
[LLVMdev] [RFC] NoBuiltin Attribute
On Feb 18, 2013, at 4:45 PM, Chris Lattner <clattner at apple.com> wrote: > > On Feb 18, 2013, at 1:54 PM, Bill Wendling <wendling at apple.com> wrote: > >> Hi LLVMites! >> >> This patch adds the 'nobuiltin' attribute to to LLVM. This is needed during LTO, which right now ignores this attribute and command line flag. I want to make this an
2013 Feb 19
0
[LLVMdev] [RFC] NoBuiltin Attribute
On Feb 18, 2013, at 4:49 PM, Bill Wendling <wendling at apple.com> wrote: >> Hi Bill, >> >> I think the concept of this patch makes sense, but the implementation does not. >> >> I have: >> >> void foo() { >> printf("hello\n"); >> } >> >> and I build with -fno-builtin-puts. If I understand correctly, *foo* will
2013 Feb 18
5
[LLVMdev] [RFC] NoBuiltin Attribute
Hi LLVMites! This patch adds the 'nobuiltin' attribute to to LLVM. This is needed during LTO, which right now ignores this attribute and command line flag. I want to make this an IR-level attribute instead of a target-dependent attribute because it's used during IR modification and not code generation. -bw -------------- next part -------------- A non-text attachment was scrubbed...
2012 Aug 02
2
[LLVMdev] Proposal to merge SimplifyLibCalls into InstCombiner
Hi All, I finally got around to cleaning up my proposal to merge `SimplifyLibCalls` into `InstCombiner`. There is still an open question or two and I am sure there are parts that could be better specified, but this is good enough to discuss. Feedback is most welcome. Abstract ======== This proposal is an attack plan for PR11895 [1]. Currently within LLVM we have two passes that are used to
2013 Feb 19
0
[LLVMdev] [RFC] NoBuiltin Attribute
On Feb 18, 2013, at 1:54 PM, Bill Wendling <wendling at apple.com> wrote: > Hi LLVMites! > > This patch adds the 'nobuiltin' attribute to to LLVM. This is needed during LTO, which right now ignores this attribute and command line flag. I want to make this an IR-level attribute instead of a target-dependent attribute because it's used during IR modification and not code
2012 Jun 18
2
[LLVMdev] Which pass converts call printf to puts?
Could you give an example of the old instruction cannot be removed safely? Since the new instruction would produce the same context/result of the old one, I suppose it is safe to remove the old one when the new instruction is ready (inserted after the old one). Anything I missed here? Thanks, -Thomson On Mon, Jun 18, 2012 at 7:31 PM, Christoph Erhardt <christoph at sicherha.de>wrote: >
2012 Jun 18
0
[LLVMdev] Which pass converts call printf to puts?
Hi Thomson, > Ok. So it seems CI->eraseFromParent() removed the old instruction and > the new one is inserted right after this one in the inner function in > the case of printf->puts. There is another line > CI->repalceAllUsesWith(Result). I think this line could also do the > replacement besides inserting the new one in the inner function. What's > the difference
2012 Jun 18
0
[LLVMdev] Which pass converts call printf to puts?
Hi Thomson, > Could you give an example of the old instruction cannot be removed > safely? Since the new instruction would produce the same context/result > of the old one, I suppose it is safe to remove the old one when the new > instruction is ready (inserted after the old one). Anything I missed here? yes, you're missing that LLVM programs are in SSA form: A new instruction
2012 Aug 02
0
[LLVMdev] Proposal to merge SimplifyLibCalls into InstCombiner
On Aug 1, 2012, at 9:49 PM, Meador Inge <meadori at codesourcery.com> wrote: > Hi All, > > I finally got around to cleaning up my proposal to merge `SimplifyLibCalls` > into `InstCombiner`. There is still an open question or two and I am sure > there are parts that could be better specified, but this is good enough to > discuss. Feedback is most welcome. Fantastic,
2012 Aug 03
2
[LLVMdev] Proposal to merge SimplifyLibCalls into InstCombiner
On 08/02/2012 11:11 AM, Chris Lattner wrote: >> A new self-contained `LibCallSimplifier` class will be created. An instance >> of the class will be instantiated when running the `InstCombiner` pass. It's >> folding functionality will be invoked from `InstCombiner::tryOptimizeCall` and >> the implementation will be table-driven like `SimplifyLibCalls`. All of the
2012 Aug 03
0
[LLVMdev] Proposal to merge SimplifyLibCalls into InstCombiner
On Aug 3, 2012, at 12:56 PM, Meador Inge <meadori at codesourcery.com> wrote: >>> An option for enabling/disabling library call simplification in `InstCombiner` >>> will be available. For backwards compatibility perhaps it should remain >>> '-simplify-libcalls'. The `NumSimplified` and `NumAnnotated` statistics shall >>> be added to
2013 Feb 19
4
[LLVMdev] [RFC] NoBuiltin Attribute
On Feb 18, 2013, at 6:10 PM, Chris Lattner <clattner at apple.com> wrote: > On Feb 18, 2013, at 4:49 PM, Bill Wendling <wendling at apple.com> wrote: >>> Hi Bill, >>> >>> I think the concept of this patch makes sense, but the implementation does not. >>> >>> I have: >>> >>> void foo() { >>>
2011 Jan 17
5
[LLVMdev] How to get the name and argument of a function
Hi everyone: The code I am analyzing is : int main() { int i = 0; printf("hello world!"); printf( "%d" , i ); } I want to get each place where printf is called, and the argument used during that call. so I write llvm pass code like: void Myfunction( Function & F){ for( Function::iterator b = F.begin() , be = F.end() ;
2016 Jan 28
4
[RFC] Canonicalize libcalls to intrinsics
Hi, I would like to propose that when available, if a C builtin function has an equivalent llvm intrinsic, that the intrinsic be the preferred form. The equivalent clang __builtin should emit the intrinsic, and SimplifyLibCalls should replace calls with the intrinsic. For context, this came up on an old review thread: http://reviews.llvm.org/D5896 There are a few motivations for this: 1.
2010 Sep 25
2
[LLVMdev] Strange exception in SelectionDAGBuilder
I'm working on the code to handle GC tracing of "intermediate values" (as described in the GC doc), and I've run into a weird problem. (Note, this has nothing to do with the patch I have proposed, this error occurs with regular old pointer-allocas.) The exception I am getting occurs in this code here in SelectionDAGBuilder.cpp: *case* *Intrinsic*::gcroot: *if* (GFI) {
2015 Aug 06
2
[LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event
On Wed, Aug 05, 2015 at 04:28:13PM +0800, Wangnan (F) wrote: > > It doesn't work for me at first since in my llvm there's only > llvm.bpf.load.*. > > I think llvm.bpf.store.* belone to some patches you haven't posted yet? nope. only loads have special instructions ld_abs/ld_ind which are represented by these intrinsics. stores, so far, are done via single
2011 Jan 19
0
[LLVMdev] How to get the name and argument of a function
Thanks a lot! I finally fix my problem. My code is like this: //CallInst* pCall pCall is a printf called in my situation if( ConstantExpr * pCE = dyn_cast<ConstantExpr>( pCall->getArgOperand(0))){ if( GlobalVariable * pGV = dyn_cast<GlobalVariable>( pCE->getOperand(0))){ if( ConstantArray * pCA = dyn_cast<ConstantArray>(