similar to: [LLVMdev] should AlwaysInliner inline this case?

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] should AlwaysInliner inline this case?"

2015 Jan 05
3
[LLVMdev] should AlwaysInliner inline this case?
Philip, I post here because I think AlwaysInliner should inline it. I want to detect the indirect calls for Inliner, and I want to hear inputs. let me define indirect call first in my idea. In one single expression, one function may be subject to bitcast more than one time. we can detect this situation and treat it as a regular call of last function, is that okay? thanks, --lx On Mon, Jan 5,
2015 Jan 05
2
[LLVMdev] should AlwaysInliner inline this case?
hi, Pete, I understand InstCombine may simplify bitcast to nothing, but the order matters. AlwaysInliner happens in very early stage, and we never call it again. if InstCombine works, can we invoke it before Inliner? thanks, --lx On Mon, Jan 5, 2015 at 5:40 PM, Pete Cooper <peter_cooper at apple.com> wrote: > Hi lx, Philip > > I've seen an instcombine which helps with this
2015 Jan 05
3
[LLVMdev] should AlwaysInliner inline this case?
On Mon, Jan 5, 2015 at 1:40 AM, Pete Cooper <peter_cooper at apple.com> wrote: > Hi lx, Philip > > I've seen an instcombine which helps with this situation. It fires when > the function types on both sides of the bitcast have the same number of > operands and compatible types. It then adds bitcasts on the arguments and > removes the one on the called function. > It
2020 Jan 15
4
Finding callees of a function
I searched the doxygen documentation and could not find a solution to my task: In a ModulePass running at EP_OptimizerLast, if I have a function F like in: bool Foo:runOnModule(Module &M) { LLVMContext &C = M.getContext(); for (auto &F : M) { // magic here if I want to know from which function (callee) each function is called - how can I do this? (so that I e.g. have
2009 Apr 15
0
[LLVMdev] Patch: MSIL backend global pointers initialization
Hi, Artur > The interesting for me part of the CallInst is printf(i8* noalias %0, i32 > 123). > I was diging in doxygen documentation but I really can't see the easy way to > compare those instructions and again finish with reinvented (but working) > wheel ;). Ah, sorry. I missed that you're doing variadic calls, not casting variadic function to definite ones. I think you
2009 Apr 15
2
[LLVMdev] Patch: MSIL backend global pointers initialization
Hello, > So, looking for type of callee (not result, but function type!) you'll > obtain the > real "signature" of callee and if you'll strip all pointer cast you'll > obtain the "declaration" (=variadic) type of the callee. Maybe I misunderstood something but I just get the variadic declaration not the real "signature", like this: const
2018 Jul 03
2
Why Clang is yielding different LLVM IR return type for the same function
Hi: So I have a library function called fooo() in a source file B.c and an external A.c file that is referencing a function fooo() in it. foo is returning a pointer to a structure A.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* } declare i8* @fooo() #2 B.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* }
2009 Jun 18
2
[LLVMdev] Referring to an argument in another function
I would like to instrument certain function calls with a function call of my own that takes some of the same arguments. For example, I would like to instrument calls to free with some function foo, so the C code would look like: foo(myarg1, myarg2, ptr); free(ptr); The problem occurs when I grab the arg from the free function and try to pass it to foo... if (isCallToFree(&I)) { Value*
2010 Nov 30
2
[LLVMdev] the called function equal NULL
Hi, I have a llvm-pass in hand written by other people. There are following statements that I couldn't understand: -------------------------------program---------------------------------------------------- ... if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) { const CallSite cs(inst); if (cs.getCalledFunction() == NULL) return dealAtIndirectCall(cs); else
2013 Apr 26
2
[LLVMdev] CallGraph
Thanks for the response. I looked and I cannot see what exactly I need. I saw getCalledFunction() so I need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an instruction. It seems not easier than the "unelegant" version....if I am still at the Instruction level... I need a method that takes from a "leaf" basic block from a function (Maybe there is
2009 Nov 06
2
[LLVMdev] Functions: sret and readnone
Hi Stephan, > intrinsic float4 sample(int tex, float2 tc); > > float4 main(int tex, float2 tc) > { > float4 x = sample(tex, tc); > return 0.0; > } without additional information it would be wrong to remove the call to sample because it might write to a global variable. > As you can see, the call to the sample function is still present, > although the actual value
2018 Mar 23
3
Change function call name in a CallInst only in certain functions
Hello, In my module I have functions: a b c f3 calls "a" f2 calls "a" f1 calls "b" I would like to modify a CallInst in the f2. Now it calls "a", but I want changed it to "c". When loop over the instructions of the f2, I can get a CallInst to be modified, then I use "setName" to changed it to "c". Problem is, since
2010 Nov 30
0
[LLVMdev] the called function equal NULL
On Nov 29, 2010, at 5:22 PM, huwei8717 wrote: > Hi, > > I have a llvm-pass in hand written by other people. There are following statements that I couldn't understand: > > -------------------------------program---------------------------------------------------- > ... > if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) { > const CallSite cs(inst);
2009 Apr 16
2
[LLVMdev] Patch: MSIL backend global pointers initialization
Hi Anton > > > The interesting for me part of the CallInst is printf(i8* noalias %0, i32 > > 123). > > I was diging in doxygen documentation but I really can't see the easy way > to > > compare those instructions and again finish with reinvented (but working) > > wheel ;). > Ah, sorry. I missed that you're doing variadic calls, not casting >
2015 Sep 08
2
CallInst::getCalledFunction returns null?
I was wondering if someone could explain why CallInst::getCalledFunc behaves the way it does. For simple, direct call instructions in my IR, that method behaves just as one would expect. However, for instructions like this: %25 = call i32 (%struct._IO_FILE*, ...)* bitcast (i32 (...)* @close to i32 > (%struct._IO_FILE*, ...)*)(%struct._IO_FILE* %24), !dbg !695 getCalledFunc returns null. I
2015 Oct 22
8
RFC: Inlining report
RFC: Inlining Report Motivation Making good inlining choices while optimizing an application is often key to achieving optimal performance. While the compiler's default inlining heuristics sometimes provide great out-of-box results, optimal performance is sometimes achieved only after varying the settings of certain compiler options related to inlining or adding "always_inline" or
2013 Mar 15
0
[LLVMdev] Scheduling a custom pass to run after AlwaysInliner
Hi. I want to schedule my custom pass to run after all inlining is done, specifically i want to go after AlwaysInliner pass. But that doesn't seem to work "AU.addRequired<AlwaysInliner>();", where AU is an object AnalysisUsage AlwaysInliner seems to be in anonymous namespace in cpp file, so i can't reference it. Is there a simple way to do that? -- With best regards,
2013 Apr 26
0
[LLVMdev] CallGraph
Hi, On 26/04/13 13:17, Alexandru Ionut Diaconescu wrote: > Thanks for the response. > I looked and I cannot see what exactly I need. I saw getCalledFunction() so I > need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an > instruction. It seems not easier than the "unelegant" version....if I am still > at the Instruction level... the call graph
2018 Mar 24
0
Change function call name in a CallInst only in certain functions
You are probably calling setName() on the called Function, which in-turned renamed the called Function instead of replacing the called function. Depending on your use-case, if you are certain that you only need to modify CallInsts, then you could simply call CallInst::setCalledFunction , otherwise it’s probably wiser to use CallSite as a wrapper for both CallInst and InvokeInst. Do note, however,
2015 Aug 21
4
[RFC] AlwaysInline codegen
Hi, There is a problem with the handling of alwaysinline functions in Clang: they are not always inlined. AFAIK, this may only happen when the caller is in the dead code, but then we don't always successfully remove all dead code. Because of this, we may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function. Libc++ relies on the compiler