diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 6e8e4ac1c6a95..9d337a5a20f05 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -20813,7 +20813,7 @@ RISCVTargetLowering::getTargetConstantFromLoad(LoadSDNode *Ld) const { // Simple case, LLA. if (Ptr.getOpcode() == RISCVISD::LLA) { - auto *CNode = GetSupportedConstantPool(Ptr); + auto *CNode = GetSupportedConstantPool(Ptr.getOperand(0)); if (!CNode || CNode->getTargetFlags() != 0) return nullptr;