[PATCH] D153414: [LLVM] Do not speculate convergent calls

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 06:15:14 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:6006-6012
+    if (CI->isConvergent())
+      return false;
 
     // The called function could have undefined behavior or side-effects, even
     // if marked readnone nounwind.
+    const Function *Callee = CI->getCalledFunction();
     return Callee && Callee->isSpeculatable();
----------------
Should go through the CallBase rather than separately checking the callee and call site attributes. Also you're missing invokes


================
Comment at: llvm/test/Transforms/SimplifyCFG/attr-convergent.ll:46
+}
+
 declare void @barrier() convergent
----------------
Add invoke test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153414



More information about the llvm-commits mailing list