[PATCH] D140168: Do not mark non-phi loop var def as loop-carried dep

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 14:02:54 PST 2022


thopre created this revision.
thopre added reviewers: bcahoon, sgundapa.
Herald added a subscriber: hiraditya.
Herald added a project: All.
thopre requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As spotted by Sumanth Gundapaneni, commit
c8be35293c82f216e975c56f62ddf9199a22f2e2 <https://reviews.llvm.org/rGc8be35293c82f216e975c56f62ddf9199a22f2e2> incorrectly marked loop
variable not defined by a PHI as loop-carried dependencies. This commit
fixes that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140168

Files:
  llvm/lib/CodeGen/MachinePipeliner.cpp


Index: llvm/lib/CodeGen/MachinePipeliner.cpp
===================================================================
--- llvm/lib/CodeGen/MachinePipeliner.cpp
+++ llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -2280,7 +2280,7 @@
   MachineInstr *DefS = MRI.getVRegDef(BaseOpS->getReg());
   MachineInstr *DefD = MRI.getVRegDef(BaseOpD->getReg());
   if (!DefS || !DefD || !DefS->isPHI() || !DefD->isPHI())
-    return true;
+    return false;
 
   unsigned InitValS = 0;
   unsigned LoopValS = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140168.483335.patch
Type: text/x-patch
Size: 487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221215/d1d045b5/attachment.bin>


More information about the llvm-commits mailing list