[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332593: CodeGen: Fix invalid bitcast for lifetime.start/end (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-16 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. https://reviews.llvm.org/D45900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 146987. yaxunl edited the summary of this revision. yaxunl added a comment. Add optional argument to CreateMemTemp and CreateTempAlloca to get the original alloca and use it for lifetime intrinsic. https://reviews.llvm.org/D45900 Files:

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. That would work. I think it would be reasonable for AutoVarEmission to store that pointer if it makes things easier. https://reviews.llvm.org/D45900 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1093160, @rjmccall wrote: > In https://reviews.llvm.org/D45900#1093154, @yaxunl wrote: > > > In https://reviews.llvm.org/D45900#1083377, @rjmccall wrote: > > > > > Oh, I see, it's not that the lifetime intrinsics don't handle pointers in

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D45900#1093154, @yaxunl wrote: > In https://reviews.llvm.org/D45900#1083377, @rjmccall wrote: > > > Oh, I see, it's not that the lifetime intrinsics don't handle pointers in > > the alloca address space, it's that we might have already

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1083377, @rjmccall wrote: > Oh, I see, it's not that the lifetime intrinsics don't handle pointers in the > alloca address space, it's that we might have already promoted them into > `DefaultAS`. > > Do the LLVM uses of lifetime

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Oh, I see, it's not that the lifetime intrinsics don't handle pointers in the alloca address space, it's that we might have already promoted them into `DefaultAS`. Do the LLVM uses of lifetime intrinsics actually look through these address space casts? I'm wondering

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144600. yaxunl added a comment. Call Builder.CreateLifetimeStart/End. I cannot replace CodeGenFunction::EmitLifetimeStart with Builder.CreateLifetimeStart since we still need to check ShouldEmitLifetimeMarkers and do the address space cast.

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1074400, @rjmccall wrote: > These functions must predate the addition of CreateLifetimeStart and > CreateLifetimeEnd methods on IRBuilder; we should just be calling those. Sorry. I think I misunderstood your comments. I will revise

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144574. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D45900 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h test/CodeGenCXX/amdgcn_declspec_get.cpp Index:

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. These functions must predate the addition of CreateLifetimeStart and CreateLifetimeEnd methods on IRBuilder; we should just be calling those. https://reviews.llvm.org/D45900 ___ cfe-commits mailing list

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. lifetime.start/end expects pointer argument in alloca address space. However in C++ a temporary variable is in default address space. This patch casts the pointer argument of lifetime.start/end to alloca address space if necessary.