Skip to content

Commit 84ee08c

Browse files
author
Yeting Kuo
committed
[RISCV] Avoid illegal DAG combination for strict-fp nodes.
Those combines may change the exception behavior and rounding behavior. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D151992
1 parent e7b4c93 commit 84ee08c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11138,6 +11138,10 @@ static SDValue performFP_TO_INTCombine(SDNode *N,
1113811138

1113911139
SDValue Src = N->getOperand(0);
1114011140

11141+
// Don't do this for strict-fp Src.
11142+
if (Src->isStrictFPOpcode() || Src->isTargetStrictFPOpcode())
11143+
return SDValue();
11144+
1114111145
// Ensure the FP type is legal.
1114211146
if (!TLI.isTypeLegal(Src.getValueType()))
1114311147
return SDValue();
@@ -11237,6 +11241,10 @@ static SDValue performFP_TO_INT_SATCombine(SDNode *N,
1123711241

1123811242
SDValue Src = N->getOperand(0);
1123911243

11244+
// Don't do this for strict-fp Src.
11245+
if (Src->isStrictFPOpcode() || Src->isTargetStrictFPOpcode())
11246+
return SDValue();
11247+
1124011248
// Ensure the FP type is also legal.
1124111249
if (!TLI.isTypeLegal(Src.getValueType()))
1124211250
return SDValue();

0 commit comments

Comments
 (0)