[llvm] [instCombine][bugfix] Fix crash caused by using of cast in instCombineSVECmpNE (PR #102472)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 19:46:40 PDT 2024


================
@@ -1174,7 +1174,8 @@ static std::optional<Instruction *> instCombineSVECmpNE(InstCombiner &IC,
     return std::nullopt;
 
   // Where the dupq is a lane 0 replicate of a vector insert
-  if (!cast<ConstantInt>(DupQLane->getArgOperand(1))->isZero())
+  auto *DupQLaneOp1 = dyn_cast<ConstantInt>(DupQLane->getArgOperand(1));
----------------
wuxie2022 wrote:

Ok, fixed.

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


More information about the llvm-commits mailing list