[PATCH] D101187: [MachineCSE] Prevent CSE of non-local convergent instrs

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 14:03:19 PDT 2021


rtereshin added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCSE.cpp:600
+    // extended definition.
+    if (MI->isConvergent() && MI->getParent() != CSMI->getParent()) {
+      LLVM_DEBUG(dbgs() << "*** Convergent MI and subexpression exist in "
----------------
dsanders wrote:
> foad wrote:
> > Do we also need this check in ProcessBlockPRE?
> I think it's needed there too
@mkitzan IIUC (which might be not the case) PRE not checking for isConvergent is a genuine bug, unlike the CSE part: PRE moves ops into predicated blocks, making them more predicated than before, which is illegal for isConvergent.

If that's the case, perhaps in case of PRE `isConvergent` check could be a part of `isPRECandidate`.


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

https://reviews.llvm.org/D101187



More information about the llvm-commits mailing list