Skip to content

Commit

Permalink
[instCombine][bugfix] Fix crash caused by using of cast in instCombin…
Browse files Browse the repository at this point in the history
…eSVECmpNE (llvm#102472)
  • Loading branch information
cceerczw authored Aug 23, 2024
1 parent e3ce979 commit 67a9093
Show file tree
Hide file tree
Showing 2 changed files with 413 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,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 *DupQLaneIdx = dyn_cast<ConstantInt>(DupQLane->getArgOperand(1));
if (!DupQLaneIdx || !DupQLaneIdx->isZero())
return std::nullopt;

auto *VecIns = dyn_cast<IntrinsicInst>(DupQLane->getArgOperand(0));
Expand Down
Loading

0 comments on commit 67a9093

Please sign in to comment.