We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83c1d00 commit b0e05a5Copy full SHA for b0e05a5
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -18385,7 +18385,7 @@ bool RISCVTargetLowering::isDesirableToCommuteWithShift(
18385
auto *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1));
18386
18387
// Bail if we might break a sh{1,2,3}add pattern.
18388
- if (Subtarget.hasStdExtZba() && C2->getZExtValue() >= 1 &&
+ if (Subtarget.hasStdExtZba() && C2 && C2->getZExtValue() >= 1 &&
18389
C2->getZExtValue() <= 3 && N->hasOneUse() &&
18390
N->user_begin()->getOpcode() == ISD::ADD &&
18391
!isUsedByLdSt(*N->user_begin(), nullptr) &&
0 commit comments