diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -8370,7 +8370,7 @@ if (!isIntEqualitySetCC(Cond)) return SDValue(); - const APInt &C1 = cast(N1)->getAPIntValue(); + const APInt &C1 = N1C->getAPIntValue(); SDLoc dl(N); // If the constant is larger than 2^32 - 1 it is impossible for both sides