[PATCH] D128539: [GISel] Don't fold convergent instruction across CFG

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 11:22:10 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp:63
+  // Convergent instructions cannot be moved in the CFG.
+  if (MI.isConvergent() && MI.getParent() != IntoMI.getParent())
+    return false;
----------------
qcolombet wrote:
> arsenm wrote:
> > The block based check will probably break down with convergence tokens. Could this just skip convergent altogether?
> We could, but I was worried this would introduce regressions when the pattern would legitimately apply.
> In particular, if we don't fold when the things are in the same block, we will regress compared to SDISel.
> 
> When the convergence tokens land (they are not landed right?), we'll have to fix SDISel, so maybe it is okay to have to fix GISel at that point?
> I.e., for now let's match SDISel?
> 
> What do you think?
OK, I guess this can match. Basically every isConvergent check will probably be broken anyway


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128539



More information about the llvm-commits mailing list