similar to: [LLVMdev] Forcing function inline not working

Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] Forcing function inline not working"

2009 Sep 17
0
[LLVMdev] Forcing function inline not working
On Sep 16, 2009, at 6:55 PM, madiyaan wrote: > > I have the following code: > > static inline void foo() __attribute((always_inline)); > > int a; > static inline void foo() > { > a++; > } > > int main(int argc, char *argv[]) > { > foo(); > return 0; > } This works fine in current sources. You should upgrade; 2.5 has been out for a while and
2009 Sep 17
2
[LLVMdev] Forcing function inline not working
Thanks for your message. However, even with using version 2.5 of llvm the function is not inlined. Can you try this with your llvm with the same opt flags, which are as follows? -O3 -debug-only=inline -mem2reg If it does work for you, can you tell me the exact flags you used for clang or llvm-gcc to produce the .bc file and the exact flags you specified when you invoked opt? Does the inlining
2009 Sep 17
0
[LLVMdev] Forcing function inline not working
I got the code to work in a LLVM 2.5. I think the reason your code wasn't working is that the function definition and declaration for foo were missing 'void'. This is perfectly legal C but maybe there's a bug in the inliner pass that sees the function in the module and the symbol table as different. Here are the files I used: [test.c] int a; void foo(void); int main(int argc,
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 points to copies of
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
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,
2018 Feb 02
2
Debug info error on bitcode inline modification
Hi, I'm trying to inline function defined in another bitcode module via bitcode modification. I'm linking multiple bitcode modules, setting inline related attributes, applying -always-inline pass, but then debug info error occurs. It seems debug info metadata isn't properly updated on inlining. How can I fix it? I'm using LLVM 3.8.1 on OS X (On below example target is Android but
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 exiting my pass >
2018 Feb 02
0
Debug info error on bitcode inline modification
Every inlinable call in a function that has debug info (F->getSubprogram() returns non-null) must have a DebugLoc associated with it that has a scope chain that ends in that same DISubprogram. https://llvm.org/docs/SourceLevelDebugging.html discusses some of the debug info IR metadata in LLVM. On Fri, Feb 2, 2018 at 1:03 AM Ku Nanashi via llvm-dev < llvm-dev at lists.llvm.org> wrote:
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
2018 Feb 05
1
Debug info error on bitcode inline modification
> Every inlinable call in a function that has debug info (F->getSubprogram() returns non-null) must have a DebugLoc associated with it that has a scope chain that ends in that same DISubprogram. Thank you for the comment! I don't know if this is a proper way to fix, but after I add DebugLoc same as inserting position instruction, no error occurs.
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
2016 Jun 16
5
Intended behavior of CGSCC pass manager.
On Tue, Jun 14, 2016 at 11:29 PM, Xinliang David Li <davidxl at google.com> wrote: > > > On Thu, Jun 9, 2016 at 3:26 AM, Sean Silva <chisophugis at gmail.com> wrote: > >> >> >> On Wed, Jun 8, 2016 at 8:14 PM, Xinliang David Li <davidxl at google.com> >> wrote: >> >>> >>> >>> On Wed, Jun 8, 2016 at 4:38 PM, Sean
2016 Jun 09
2
Intended behavior of CGSCC pass manager.
On Wed, Jun 8, 2016 at 8:14 PM, Xinliang David Li <davidxl at google.com> wrote: > > > On Wed, Jun 8, 2016 at 4:38 PM, Sean Silva <chisophugis at gmail.com> wrote: > >> >> >> On Wed, Jun 8, 2016 at 12:31 PM, Xinliang David Li <davidxl at google.com> >> wrote: >> >>> >>> >>> On Wed, Jun 8, 2016 at 4:19 AM, Sean
2016 Jun 16
2
Intended behavior of CGSCC pass manager.
> To clarify, we're trying to provide this invariant on the "ref" graph or > on the graph with direct calls only? I think the invariant need only apply > to the former > More clarification needed :) What do you mean by 'invariant need only apply to the former'? > if we're relying on this for correctness (i.e. an analysis must visit all > callees
2016 Jun 08
2
Intended behavior of CGSCC pass manager.
On Wed, Jun 8, 2016 at 12:31 PM, Xinliang David Li <davidxl at google.com> wrote: > > > On Wed, Jun 8, 2016 at 4:19 AM, Sean Silva <chisophugis at gmail.com> wrote: > >> Hi Chandler, Philip, Mehdi, (and llvm-dev,) >> >> (this is partially a summary of some discussions that happened at the >> last LLVM bay area social, and partially a discussion
2016 Jun 24
2
Strange opt result
Hi, opt -O1 converts the attached test.ll to test_opt.ll. " opt --version LLVM (http://llvm.org/): LLVM version 3.8.0 DEBUG build with assertions. Built Jun 23 2016 (18:32:09). Default target: i686-pc-linux-gnu Host CPU: k8-sse3 " test.ll: " ; ModuleID = 'test.bc' @__mla__system.1 = global i32 0 @0 = internal global [12 x i8] zeroinitializer @1 = internal global
2010 Nov 24
3
[LLVMdev] LLVM Inliner
On Wed, Nov 24, 2010 at 12:37 PM, Nick Lewycky <nicholas at mxc.ca> wrote: > Xinliang David Li wrote: > >> Hi, I browsed the LLVM inliner implementation, and it seems there is >> room for improvement. (I have not read it too carefully, so correct me >> if what I observed is wrong). >> >> First the good side of the inliner -- the function level summary
2016 Jun 17
5
Intended behavior of CGSCC pass manager.
On Thu, Jun 16, 2016 at 11:12 AM, Sanjoy Das <sanjoy at playingwithpointers.com > wrote: > Hi Sean, > > On Thu, Jun 16, 2016 at 4:48 AM, Sean Silva via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > One question is what invariants we want to provide for the visitation. > > > > For example, should a CGSCC pass be able to assume that all
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