Skip to content

Commit

Permalink
fold truncusat(fp_to_uint_sat (x)) -> fp_to_uint_sat(x)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkHanbum committed Jul 21, 2024
1 parent 108a26c commit 197e28b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14886,6 +14886,11 @@ SDValue DAGCombiner::visitTRUNCATE_USAT(SDNode *N) {
FPInstr.getOperand(0),
DAG.getValueType(VT.getScalarType()));
return Sat;
} else if (FPInstr.getOpcode() == ISD::FP_TO_UINT_SAT) {
SDValue Sat = DAG.getNode(ISD::FP_TO_UINT_SAT, SDLoc(FPInstr), VT,
FPInstr.getOperand(0),
DAG.getValueType(VT.getScalarType()));
return Sat;
}

return SDValue();
Expand Down

0 comments on commit 197e28b

Please sign in to comment.