Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. second attempt in r247494 Repository: rL LLVM http://reviews.llvm.org/D12087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgenii Stepanov via cfe-commits
Thanks. I just reproduced it on release w/o asserts build and fixed locally. The other problem is fixed as well, I'll try re-landing now. I'll keep an eye on the bot later today and will revert again if necessary. On Fri, Sep 11, 2015 at 6:02 PM, H.J. Lu wrote: > On Fri, Sep 11, 2015 at 4:45 PM,

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread H.J. Lu via cfe-commits
On Fri, Sep 11, 2015 at 4:45 PM, Evgenii Stepanov wrote: > Does it say that there is no entry basic block? I.e. the output > apparently looks like > > define void @h() #1 { > store void ()* @f1, void ()** @p, align 8 > > Could you confirm it? Never seen this behavior. > > I'm going to revert the

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:543 @@ +542,3 @@ + if (Fn->isUsedByMetadata()) +llvm::ValueAsMetadata::handleRAUW(Fn, StubFn); +} As the comment says. W/o this, the debug info for .alwaysinline instructions is attached

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 34610. eugenis added a comment. Fixed the debug info problem. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/Code

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgenii Stepanov via cfe-commits
Does it say that there is no entry basic block? I.e. the output apparently looks like define void @h() #1 { store void ()* @f1, void ()** @p, align 8 Could you confirm it? Never seen this behavior. I'm going to revert the change due to this and also one broken gdb test (something wrong with de

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread H.J. Lu via cfe-commits
On Fri, Sep 11, 2015 at 1:31 PM, Evgeniy Stepanov via cfe-commits wrote: > eugenis closed this revision. > eugenis added a comment. > > r247465, thanks for the review! > On Fedora 22/x86-64, I got FAIL: Clang :: CodeGen/always_inline.c (3049 of 26132) TEST 'Clang :: CodeGen/

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgeniy Stepanov via cfe-commits
eugenis closed this revision. eugenis added a comment. r247465, thanks for the review! Repository: rL LLVM http://reviews.llvm.org/D12087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-11 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 34578. eugenis added a comment. rebase, fix a merge conflict Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeG

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-10 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. I'm going to commit this tomorrow unless someone speaks up. Repository: rL LLVM http://reviews.llvm.org/D12087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-04 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CodeGenModule.h:505 @@ +504,3 @@ + + llvm::SmallVector AlwaysInlineFunctions; + Right. Sorry I missed the comment. I've switched this to a vector. Repository: rL LLVM http://reviews.llvm.org/D12087 __

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-04 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 34095. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGe

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-04 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CodeGenModule.h:505 @@ +504,3 @@ + + llvm::SetVector AlwaysInlineFunctions; + Did you try making this a vector? It'd be nice to avoid the set overhead here if we can. Repository: rL LLVM http://reviews.l

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-03 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. In http://reviews.llvm.org/D12087#239243, @yaron.keren wrote: > In CGCXX.cpp, may be fixable after this commit: > > // FIXME: An extern template instantiation will create functions with > // linkage "AvailableExternally". In libc++, some classes also define > // mem

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-03 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 33997. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGe

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-03 Thread Yaron Keren via cfe-commits
yaron.keren added a comment. In CGCXX.cpp, may be fixable after this commit: // FIXME: An extern template instantiation will create functions with // linkage "AvailableExternally". In libc++, some classes also define // members with attribute "AlwaysInline" and expect no reference to // b

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-02 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 33868. eugenis marked 6 inline comments as done. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h l

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-02 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:485 @@ +484,3 @@ + std::string Name = Fn->getName(); + std::string InlineName = Name + ".inlinefunction"; + Fn->setName(InlineName); I have a slight preference for ".alwaysinline" over ".in

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-01 Thread Evgeniy Stepanov via cfe-commits
eugenis marked 2 inline comments as done. eugenis added a comment. Repository: rL LLVM http://reviews.llvm.org/D12087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-01 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 33766. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGe

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-01 Thread Reid Kleckner via cfe-commits
rnk accepted this revision. rnk added a reviewer: rnk. rnk added a comment. This revision is now accepted and ready to land. lgtm Comment at: lib/CodeGen/CodeGenModule.cpp:463 @@ +462,3 @@ + +// if (U.getUser() == GV) continue; + Commented out code? ===

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-01 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:469-470 @@ +468,4 @@ + llvm::LLVMContext &Ctx = getModule().getContext(); + llvm::Function *StubFn = + llvm::Function::Create(FT, Fn->getLinkage(), Name, &getModule()); + assert(StubFn->getName() == N

Re: [PATCH] D12087: always_inline codegen rewrite

2015-09-01 Thread Evgeniy Stepanov via cfe-commits
eugenis set the repository for this revision to rL LLVM. eugenis updated this revision to Diff 33746. eugenis marked an inline comment as done. Repository: rL LLVM http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/Co

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-31 Thread Reid Kleckner via cfe-commits
rnk added a subscriber: rnk. Comment at: lib/CodeGen/CodeGenModule.cpp:469-470 @@ +468,4 @@ + llvm::LLVMContext &Ctx = getModule().getContext(); + llvm::Function *StubFn = + llvm::Function::Create(FT, Fn->getLinkage(), Name, &getModule()); + assert(StubFn->getName() == Nam

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgenii Stepanov via cfe-commits
On Mon, Aug 17, 2015 at 1:59 PM, David Blaikie wrote: > > > On Mon, Aug 17, 2015 at 11:07 AM, Evgeniy Stepanov via cfe-commits > wrote: >> >> eugenis created this revision. >> eugenis added reviewers: chandlerc, rsmith. >> eugenis added a subscriber: cfe-commits. >> eugenis set the repository for

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Richard Smith via cfe-commits
On Mon, Aug 17, 2015 at 1:59 PM, David Blaikie wrote: > > > On Mon, Aug 17, 2015 at 11:07 AM, Evgeniy Stepanov via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> eugenis created this revision. >> eugenis added reviewers: chandlerc, rsmith. >> eugenis added a subscriber: cfe-commits. >> e

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:513 @@ +512,3 @@ +void CodeGenModule::RewriteAlwaysInlineFunctions() { + for (llvm::Function *Fn : AlwaysInlineFunctions) +RewriteAlwaysInlineFunction(Fn); Done. Should I make it a "Smal

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 32341. http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGen/2008-05-19-AlwaysInli

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread David Blaikie via cfe-commits
On Mon, Aug 17, 2015 at 11:07 AM, Evgeniy Stepanov via cfe-commits < cfe-commits@lists.llvm.org> wrote: > eugenis created this revision. > eugenis added reviewers: chandlerc, rsmith. > eugenis added a subscriber: cfe-commits. > eugenis set the repository for this revision to rL LLVM. > > Currently

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:513 @@ +512,3 @@ +void CodeGenModule::RewriteAlwaysInlineFunctions() { + for (llvm::Function *Fn : AlwaysInlineFunctions) +RewriteAlwaysInlineFunction(Fn); Does it matter that this traver

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis marked an inline comment as done. Comment at: lib/CodeGen/CodeGenModule.cpp:447-448 @@ +446,4 @@ +if (C && !isa(C)) { + C->handleOperandChange(GV, IndirectReplacement, &U); + continue; +} Good catch. Comment at: lib/Code

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 32338. http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGen/2008-05-19-AlwaysInli

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Paul Robinson via cfe-commits
probinson added a subscriber: probinson. Comment at: lib/CodeGen/CodeGenModule.cpp:496 @@ +495,3 @@ + llvm::ReturnInst::Create(Ctx, CI, BB); + } + What does the debug info look like for the wrapper? http://reviews.llvm.org/D12087 ___

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis removed rL LLVM as the repository for this revision. eugenis updated this revision to Diff 32330. http://reviews.llvm.org/D12087 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h lib/CodeGen/ItaniumCXXABI.cpp test/CodeGen/2008-05-19-AlwaysInl

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Chandler Carruth via cfe-commits
chandlerc added a comment. FYI, we should send an RFC to llvm-dev about the design change of always_inline and make sure folks generally like the IR-level direction as well. We can point at this review as an example. I'm happy to write that up and send it if that's useful? Repository: rL LL

Re: [PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:447-448 @@ +446,4 @@ + C->handleOperandChange(GV, IndirectReplacement, &U); +} else if (!isa(U.getUser()) && + !isa(U.getUser())) { + U.set(IndirectReplacement); Do

[PATCH] D12087: always_inline codegen rewrite

2015-08-17 Thread Evgeniy Stepanov via cfe-commits
eugenis created this revision. eugenis added reviewers: chandlerc, rsmith. eugenis added a subscriber: cfe-commits. eugenis set the repository for this revision to rL LLVM. Currently always_inline definitions are emitted as (in most cases) an available_externally llvm function with an alwaysinlin