[PATCH] D48640: [WIP][SROA] Preserve DebugLoc when rewriting alloca partitions

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 07:38:23 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D48640#1144941, @probinson wrote:

> Is there an existing test for rewriting the alloca, that you could modify? Instead of adding a whole new test file.
>  Otherwise seems pretty straightforward.  This appears to be a common problem, failing to setDebugLoc after creating a new instruction.


+ 1 on all points.



================
Comment at: lib/Transforms/Scalar/SROA.cpp:4032
         AI.getName() + ".sroa." + Twine(P.begin() - AS.begin()), &AI);
+    // Copy the old AI debug location over to the new one
+    NewAI->setDebugLoc(AI.getDebugLoc());
----------------
Please end sentences in comments with periods.


Repository:
  rL LLVM

https://reviews.llvm.org/D48640





More information about the llvm-commits mailing list