[llvm] [CodeGenPrepare] don't promote sdiv/srem by -1 (PR #218737)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 06:58:23 PDT 2026


================
@@ -8367,6 +8367,11 @@ class VectorPromoteHelper {
   /// Check if it is profitable to promote \p ToBePromoted
   /// by moving downward the transition through.
   bool shouldPromote(const Instruction *ToBePromoted) const {
+    if (!isSafeToSpeculativelyExecute(
+            ToBePromoted, /*CtxI=*/nullptr, /*AC=*/nullptr, /*DT=*/nullptr,
+            /*TLI=*/nullptr, /*UseVariableInfo=*/false,
+            /*IgnoreUBImplyingAttrs=*/false))
----------------
nikic wrote:

Use isSafeToSpeculativelyExecuteWithVariableReplaced() instead?

https://github.com/llvm/llvm-project/pull/218737


More information about the llvm-commits mailing list