[llvm] Fix potential crash in SLPVectorizer caused by missing check (PR #95937)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 12:20:34 PDT 2024


================
@@ -835,7 +835,7 @@ static InstructionsState getSameOpcode(ArrayRef<Value *> VL,
         auto *CallBase = cast<CallInst>(IBase);
         if (Call->getCalledFunction() != CallBase->getCalledFunction())
           return InstructionsState(VL[BaseIndex], nullptr, nullptr);
-        if (Call->hasOperandBundles() &&
+        if (Call->hasOperandBundles() && CallBase->hasOperandBundles() &&
----------------
alexey-bataev wrote:

The idea is that two calls are incompatible if they have different operand bundles. If one has a bundle but another does not, they are still incompatible.

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


More information about the llvm-commits mailing list