[PATCH] D27804: [SimplifyCFG] Merge debug locations when hoisting an instruction from a then/else branch. NFC.
Andrea Di Biagio via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 06:30:13 PST 2016
andreadb created this revision.
andreadb added reviewers: aprantl, dblaikie, rob.lougher, danielcdh.
andreadb added a subscriber: llvm-commits.
Now that a new API to merge debug locations has been committed at r289661 (see revision https://reviews.llvm.org/D26256 for more details), we can use it to "improve" the following commit: https://reviews.llvm.org/rL280995
Instead of nulling the debugloc of a commoned instruction, we use the "merged" debug location.
At the moment, this is just a no functional change since function `getMergedLocation` is just a stub and would always return a null location.
Please let me know if okay to commit.
@@ -34,7 +34,7 @@
@@ -1275,10 +1275,10 @@
// If the debug loc for I1 and I2 are different, as we are combining them
// into one instruction, we do not want to select debug loc randomly from
- // I1 or I2. Instead, we set the 0-line DebugLoc to note that we do not
- // know the debug loc of the hoisted instruction.
+ // I1 or I2.
if (!isa<CallInst>(I1) && I1->getDebugLoc() != I2->getDebugLoc())
+ DILocation::getMergedLocation(I1->getDebugLoc(), I2->getDebugLoc()));
Changed = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1082 bytes
Desc: not available
More information about the llvm-commits