================
@@ -23034,6 +23034,15 @@ SDValue X86TargetLowering::LowerFP_ROUND(SDValue Op,
SelectionDAG &DAG) const {
MVT VT = Op.getSimpleValueType();
MVT SVT = In.getSimpleValueType();
+ if (!IsStrict && VT == MVT::f16 &&
+ (In.getOpcode() == ISD::FNEG || In.getOpcode() == ISD::FABS)) {
+ SDValue Inner = In.getOperand(0);
+ if (Inner.getOpcode() == ISD::FP_EXTEND &&
+ Inner.getOperand(0).getValueType() == MVT::f16) {
+ return DAG.getNode(In.getOpcode(), DL, MVT::f16, Inner.getOperand(0));
+ }
+ }
+
----------------
phoebewang wrote:
Does it work if moving to combineFP_ROUND?
https://github.com/llvm/llvm-project/pull/189395
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits