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 @@ -11138,6 +11138,10 @@ SDValue Src = N->getOperand(0); + // Don't do this for strict-fp Src. + if (Src->isStrictFPOpcode() || Src->isTargetStrictFPOpcode()) + return SDValue(); + // Ensure the FP type is legal. if (!TLI.isTypeLegal(Src.getValueType())) return SDValue(); @@ -11237,6 +11241,10 @@ SDValue Src = N->getOperand(0); + // Don't do this for strict-fp Src. + if (Src->isStrictFPOpcode() || Src->isTargetStrictFPOpcode()) + return SDValue(); + // Ensure the FP type is also legal. if (!TLI.isTypeLegal(Src.getValueType())) return SDValue();