[llvm] [CodeGen] Simplify expandRoundInexactToOdd (PR #134988)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 9 12:32:42 PDT 2025
================
@@ -11608,28 +11608,13 @@ SDValue TargetLowering::expandRoundInexactToOdd(EVT ResultVT, SDValue Op,
// correct for this using a trick explained in: Boldo, Sylvie, and
// Guillaume Melquiond. "When double rounding is odd." 17th IMACS
// World Congress. 2005.
- unsigned BitSize = OperandVT.getScalarSizeInBits();
- EVT WideIntVT = OperandVT.changeTypeToInteger();
- SDValue OpAsInt = DAG.getBitcast(WideIntVT, Op);
- SDValue SignBit =
- DAG.getNode(ISD::AND, dl, WideIntVT, OpAsInt,
- DAG.getConstant(APInt::getSignMask(BitSize), dl, WideIntVT));
- SDValue AbsWide;
- if (isOperationLegalOrCustom(ISD::FABS, OperandVT)) {
- AbsWide = DAG.getNode(ISD::FABS, dl, OperandVT, Op);
----------------
arsenm wrote:
This should have been just using fabs regardless of legality
https://github.com/llvm/llvm-project/pull/134988
More information about the llvm-commits
mailing list