[PATCH] D136463: [SWP] Recognize mem carried dep with different base

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


thopre marked an inline comment as done.
thopre added inline comments.


================
Comment at: llvm/lib/CodeGen/MachinePipeliner.cpp:2282
+  MachineInstr *DefD = MRI.getVRegDef(BaseOpD->getReg());
+  if (!DefS || !DefD || !DefS->isPHI() || !DefD->isPHI())
+    return true;
----------------
sgundapa wrote:
> Too late to comment, but I believe this if condition will mark wrong loop carried dependences.
> 
> Eg:
> SU(0):   %62:intregs = PHI %12:intregs, %bb.8, %85:intregs, %bb.9
> SU(1):   %63:intregs = L2_loadrh_io %62:intregs, 0 :: (load (s16) from %ir.arrayidx.phi)
> ......
> ......
> ......
> SU(5):   %85:intregs = S2_storerh_pi %62:intregs(tied-def 0), 8, %66:intregs :: (store (s16) into %ir.arrayidx.phi)
> .......
> .......
> SU(10):   S2_storerh_io %85:intregs, -6, %72:intregs :: (store (s16) into %ir.arrayidx.phi + 2)
> 
> 
> SU1-SU10 will me marked as an LCD
> 
Indeed, I've created https://reviews.llvm.org/D140168 to fix that. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136463/new/

https://reviews.llvm.org/D136463



More information about the llvm-commits mailing list