[PATCH] D98218: [LSR] fix a issue that LoopStrengthReduction drop debug location unnecessarily

Yuanbo Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 8 14:03:16 PST 2021


yuanboli233 created this revision.
yuanboli233 added reviewers: jmorse, vsk.
Herald added a subscriber: hiraditya.
yuanboli233 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A proposed bug fix for a bug report: https://bugs.llvm.org/show_bug.cgi?id=48067

Preserve the original debug location for the newly created comparison instruction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98218

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -2347,6 +2347,7 @@
     new ICmpInst(Cond, Pred, Cond->getOperand(0), NewRHS, "scmp");
 
   // Delete the max calculation instructions.
+  NewCond->setDebugLoc(Cond->getDebugLoc());
   Cond->replaceAllUsesWith(NewCond);
   CondUse->setUser(NewCond);
   Instruction *Cmp = cast<Instruction>(Sel->getOperand(0));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98218.329133.patch
Type: text/x-patch
Size: 547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210308/59c8ccb8/attachment.bin>


More information about the llvm-commits mailing list