[PATCH] D149348: RFD: Do not CSE convergent calls in different basic blocks

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 11:26:39 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/IR/Instruction.cpp:578
+    // different basic blocks.
+    if (CI->isConvergent() && CI->getParent() != I->getParent())
+      return false;
----------------
arsenm wrote:
> I’m questioning whether it’s worth or correct to allow CSE of convergent operations in the same block
Surely it's correct? You could even CSE them in different blocks if there is no divergent control flow between them. When we have convergence tokens perhaps this will become trivial: you can CSE them iff they use the convergence token.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149348



More information about the llvm-commits mailing list