[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316484: CodeGen: Fix missing debug loc due to alloca (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D39069?vs=120076=120115#toc Repository: rL LLVM

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 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. Okay, LGTM. https://reviews.llvm.org/D39069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 120076. yaxunl added a comment. Revised the test by Paul's comments. https://reviews.llvm.org/D39069 Files: lib/CodeGen/CGExpr.cpp test/CodeGenOpenCL/func-call-dbg-loc.cl Index: test/CodeGenOpenCL/func-call-dbg-loc.cl

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D39069#904507, @probinson wrote: > Anytime the code between saveIP() and restoreIP() could set the current debug > location, it needs to be saved/restored along with the insertion point. I > have to say the problem is not obvious to me

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment. Anytime the code between saveIP() and restoreIP() could set the current debug location, it needs to be saved/restored along with the insertion point. I have to say the problem is not obvious to me here, so maybe saveIP/restoreIP should be changed (or eliminated in

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. The code looks fine to me. The test seems very vague to me, but I'd like Dave to weigh in on that, because I'm not sure it's reasonable to test the exact pattern here. Also, Dave, I don't know what the IR invariants around debug info are. Is this something we

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D39069#903344, @rjmccall wrote: > If this is something we generally need to be doing in all the places we > temporarily save and restore the insertion point, we should fix the basic > behavior of saveIP instead of adding explicit code to a

RE: [PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread Liu, Yaxun (Sam) via cfe-commits
>; rjmcc...@gmail.com Cc: cfe-commits@lists.llvm.org Subject: Re: [PATCH] D39069: CodeGen: Fix missing debug loc due to alloca What John said, but also a narrower test would be good - checking that the appropriate call instruction gets a debug location, rather than checking that a bunch of inlining d

Re: [PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread David Blaikie via cfe-commits
What John said, but also a narrower test would be good - checking that the appropriate call instruction gets a debug location, rather than checking that a bunch of inlining doesn't cause the assertion/verifier failure, would be good. (Clang tests should, as much as possible, not rely on or run the

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. If this is something we generally need to be doing in all the places we temporarily save and restore the insertion point, we should fix the basic behavior of saveIP instead of adding explicit code to a bunch of separate places. Can we just override saveIP() on

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Builder save/restores insertion pointer when emitting addr space cast for alloca, but does not save/restore debug loc, which causes verifier failure for certain call instructions. This patch fixes that. https://reviews.llvm.org/D39069 Files: