Skip to content

Commit f416f6c

Browse files
committed
[X86] LowerABD - remove freeze from abd*(lhs, rhs) -> trunc(abs(sub(*ext(lhs), *ext(rhs))))
Single use each of lhs/rhs so we shouldn't need them.
1 parent 33ecd93 commit f416f6c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28180,10 +28180,8 @@ static SDValue LowerABD(SDValue Op, const X86Subtarget &Subtarget,
2818028180
// abds(lhs, rhs) -> trunc(abs(sub(sext(lhs), sext(rhs))))
2818128181
// abdu(lhs, rhs) -> trunc(abs(sub(zext(lhs), zext(rhs))))
2818228182
unsigned ExtOpc = IsSigned ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
28183-
SDValue LHS = DAG.getFreeze(Op.getOperand(0));
28184-
SDValue RHS = DAG.getFreeze(Op.getOperand(1));
28185-
LHS = DAG.getNode(ExtOpc, dl, WideVT, LHS);
28186-
RHS = DAG.getNode(ExtOpc, dl, WideVT, RHS);
28183+
SDValue LHS = DAG.getNode(ExtOpc, dl, WideVT, Op.getOperand(0));
28184+
SDValue RHS = DAG.getNode(ExtOpc, dl, WideVT, Op.getOperand(1));
2818728185
SDValue Diff = DAG.getNode(ISD::SUB, dl, WideVT, LHS, RHS);
2818828186
SDValue AbsDiff = DAG.getNode(ISD::ABS, dl, WideVT, Diff);
2818928187
return DAG.getNode(ISD::TRUNCATE, dl, VT, AbsDiff);

0 commit comments

Comments
 (0)