search for: alwaysinline

Displaying 20 results from an estimated 125 matches for "alwaysinline".

Did you mean: always_inline
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))"...
2015 Aug 21
2
[cfe-dev] [RFC] AlwaysInline codegen
On Thu, Aug 20, 2015 at 7:17 PM, John McCall <rjmccall at apple.com> wrote: > > On Aug 20, 2015, at 5:19 PM, Evgenii Stepanov via cfe-dev < > cfe-dev at lists.llvm.org> wrote: > > 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 &...
2017 Nov 17
2
Ensuring that dead allocations from a custom allocator are killed by LLVM
...in>' source_filename = "Module" ; Function Attrs: inaccessiblememonly noinline norecurse nounwind declare i8* @alloc(i64) local_unnamed_addr #0 ; Function Attrs: inaccessiblememonly noinline norecurse nounwind declare void @useClosure(i8*) local_unnamed_addr #1 ; Function Attrs: alwaysinline norecurse nounwind define void @main() #1 { entry: %closure.raw = tail call noalias i8* @alloc(i64 8) %fn_slot = bitcast i8* %closure.raw to void ()** store void ()* @"case_ackerman(atom-3 atom-10)_alts", void ()** %fn_slot, align 8, !invariant.group !0 tail call void @useClosure(...
2017 Jun 24
1
musttail & alwaysinline interaction
...gram: @globalSideEffect = global i32 0 define void @tobeinlined() #0 { entry: store i32 3, i32* @globalSideEffect, align 4 musttail call fastcc void @tailcallee(i32 3) ret void } define fastcc void @tailcallee(i32 %i) { entry: call void @tobeinlined() ret void } attributes #0 = { alwaysinline } Clearly, if this is processed with opt -alwaysinline, it will lead to a correct tail call since the call to "tobeinlined" will be inlined. However, because opt checks for the correctness of the module when it is being loaded, it fails the verifyModule() check with: cannot guarantee...
2012 Nov 05
2
[LLVMdev] Adding function attributes
Hi Duncan, thanks for the quick answer. Yes I'm sure the runOnModule is being called, and when I dump the functions before exiting the method I can see the AlwaysInline attribute. I'll check InlineAlways.cpp and will reimplement as last resource but I still wonder why this is not working. On Mon, Nov 5, 2012 at 5:03 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Arnaldo, > > > I am coding a ModulePass in which I want to add an Always...
2012 Nov 05
2
[LLVMdev] Adding function attributes
Hello everyone, I am coding a ModulePass in which I want to add an AlwaysInline attribute to every function so that they can be later inlined by the -always-inline pass. However, the changes to the function seem to be lost after exiting my pass because the AlwaysInline attribute is not in the output LLVM IR. Maybe the function iterator passed by the module object actually po...
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, Dmitry -----------...
2010 Jan 08
4
[LLVMdev] Inlining
...llvm-as testInline.ll opt -always-inline testInline.bc -o testInline.optbc llvm-dis -f testInline.optbc -o testInline.optdis.ll rm testInline.bc testInline.optbc gemini:~/Projects/Nil/nil(0)$ cat testInline.optdis.ll ; ModuleID = 'testInline.optbc' define linkonce fastcc i32 @foo(i32 %arg) alwaysinline { %result = mul i32 %arg, 7 ; <i32> [#uses=1] ret i32 %result } define i32 @main(i32 %argc, i8** %argv) { %retVal = call fastcc i32 @foo(i32 6) alwaysinline ; <i32> [#uses=1] ret i32 %retVal } gemini:~/Projects/Nil/nil(0)$ --- Perhaps the -always-inline p...
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 situ...
2012 Nov 05
0
[LLVMdev] Adding function attributes
Hi Arnaldo, On 05/11/12 10:02, Arnaldo wrote: > Hi Duncan, thanks for the quick answer. > > Yes I'm sure the runOnModule is being called, and when I dump the functions > before exiting the method I can see the AlwaysInline attribute. > > I'll check InlineAlways.cpp and will reimplement as last resource but I still > wonder why this is not working. if you want more help with this please provide the complete code for your pass. Ciao, Duncan. > > > On Mon, Nov 5, 2012 at 5:03 PM, Duncan Sands &l...
2012 Nov 21
1
[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
...e attribute group's ID: >> >> attribute_group_ref := attrgroup(<attrgroup_id>) >> >> This is an example of an attribute group for a function that should always be >> inlined, has stack alignment of 4, and doesn't unwind: >> >> attrgroup #1 = { alwaysinline, nounwind, alignstack=4 } >> >> void @foo() attrgroup(#1) { ret void } >> >> An object may refer to more than one attribute group. In that situation, the >> attributes are merged. >> >> Attribute groups are important for keeping `.ll' files readable, be...
2012 Nov 05
0
[LLVMdev] Adding function attributes
Hi Arnaldo, > I am coding a ModulePass in which I want to add an AlwaysInline attribute to > every function so that they can be later inlined by the -always-inline pass. why not just do the inlining yourself. The always inliner code is at lib/Transforms/IPO/InlineAlways.cpp, and it's pretty short. > However, the changes to the function seem to be lost after exit...
2010 Jan 09
0
[LLVMdev] Inlining
...ways-inline testInline.bc -o testInline.optbc > llvm-dis -f testInline.optbc -o testInline.optdis.ll > rm testInline.bc testInline.optbc > gemini:~/Projects/Nil/nil(0)$ cat testInline.optdis.ll > ; ModuleID = 'testInline.optbc' > > define linkonce fastcc i32 @foo(i32 %arg) alwaysinline { > Try using 'internal' linkage instead of 'linkonce'. If you're sure you really want linkonce then you'd need to use linkonce_odr to get inlining here. Also, drop the alwaysinline attribute and '-always-inline' flag. The normal inliner (aka. "opt -in...
2013 Jun 17
2
[LLVMdev] [cfe-dev] [RFC] add Function Attribute to disable optimization
...like to discuss this proposal with the rest of the community to > share opinions and have feedback on this. > > =================================================== > Interactions with the existing function attributes: > > LLVM allows to decorate functions with 'noinline', alwaysinline' and > 'inlinehint'. We think that it makes sense for 'optnone' to implicitly > imply 'noinline' (at least from a user's point of view) and therefore > 'optnone' should be considered incompatible with 'alwaysinline' and > 'inlinehint&...
2010 Jan 08
4
[LLVMdev] Inlining
...ddq $8, %rsp ret .size main, .-main .Leh_func_end2: --- Even this monkey (thinks he) can see the constant 6 being passed to foo in %edi. So far so good. Now I tried to get it to inline, without much luck. Putting together everything I tried into one test, I changed 'noinline' to 'alwaysinline' (and changing the linkage, as I gather that would be appropriate for multiple files) --- ; testInline.ll -- test code for inlining. define linkonce fastcc i32 @foo(i32 %arg) alwaysinline { %result = mul i32 %arg, 7 ret i32 %result } define i32 @main(i32 %argc, i8 **%argv) { %re...
2009 Jul 14
3
[LLVMdev] Unexpected failures in the DejaGNU test collection
...e check" with the DejaGNU test collection, I encounter two unexpected failures (they seem to be closely related). My question: are they well known, and if so what's the problem and how can I fix it? This is the error text I get: FAIL: /var/data/common/trunk/llvm/test/FrontendC/2008-05-19-AlwaysInline.c Failed with exit(1) at line 1 while running: /var/data/common/template_wc//install/bin/llvm-gcc -emit-llvm -w /var/data/common/trunk/llvm/test/FrontendC/2008-05-19-AlwaysInline.c -S -fno-unit-at-a-time -emit-llvm -O0 -o - | not /bin/grep sabrina /var/data/common/trunk/llvm/test/FrontendC/2008-05-...
2013 Dec 01
2
[LLVMdev] x86: inline an LLVM IR function?
Sorry for what may possibly be a rather stupid question, but how on earth do you make LLC inline a function? I've got this code: attributes 0 = { alwaysinline nounwind } define internal i32 @lambda(i32 %a, i32 %x) #0 { %1 = add i32 %a, %x ret i32 %1 } define i32 @foo(i32 %a) nounwind { %1 = call i32 @lambda(i32 %a, i32 10) ret i32 %1 } And no matter what I do, the function @lambda ends up being called with a call in...
2010 Jan 09
2
[LLVMdev] Inlining
...e linkonce for inline functions.+ A bit more experimentation shows that it still inlines with the default linkage, the only difference being it retains a non-inlined version as well. With 'internal' it omits the non-inlined version. I think I see why that's true. > Also, drop the alwaysinline attribute and '-always-inline' flag. The > normal inliner (aka. "opt -inline" which is run as part of "opt -O3") > should inline it. Yes, it still did after I removed them. Since I'm clearly not guessing well here, when would one want to use "alwaysinlin...
2013 Jun 17
0
[LLVMdev] [RFC] add Function Attribute to disable optimization
...like to discuss this proposal with the rest of the community to > share opinions and have feedback on this. > > =================================================== > Interactions with the existing function attributes: > > LLVM allows to decorate functions with 'noinline', alwaysinline' and > 'inlinehint'. We think that it makes sense for 'optnone' to implicitly > imply 'noinline' (at least from a user's point of view) and therefore > 'optnone' should be considered incompatible with 'alwaysinline' and > 'inlinehint&...
2018 Feb 16
3
Missing attribute inference cases
...al cases, we check hasExactDefinition before checking properties of the function declaration (such as return type).  To my knowledge, facts on declarations are valid even in the place of derefinement.  This results in the analysis being unnecessarily conservative around external declarations. *AlwaysInline and hasExactDefinition* I believe, but have not fully thought through, that it is legal to IPO across an inexact definition boundary if a particularly callsite or declaration is marked alwaysinline.  It's not clear this matters since we'll eventually inline it anyway, but this might be...