[llvm] [SLP][NFCI] Address issues seen in downstream Coverity scan. (PR #93757)

Tyler Lanphear via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 10:35:04 PDT 2024


================
@@ -11700,8 +11700,7 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
       R.eraseInstruction(EI);
     }
     if (NumParts == 1 || UniqueBases.size() == 1) {
-      VecBase = castToScalarTyElem(VecBase);
-      return VecBase;
+      return VecBase ? castToScalarTyElem(VecBase) : nullptr;
----------------
tylanphear wrote:

Added an assertion here at the callsite.

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


More information about the llvm-commits mailing list