diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-08-04 00:12:08 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-08-04 00:12:08 +0000 |
commit | 67b453b0d1ed7ab42a9408a6eb00131e160eb421 (patch) | |
tree | 5dafc13378bdfc199028991f1103c1e6142d3176 /lib/Target/ARM/ARMISelLowering.cpp | |
parent | 8a7ffe651f706a6819e94e6a99bbb2c1bb1d4391 (diff) | |
download | external_llvm-67b453b0d1ed7ab42a9408a6eb00131e160eb421.zip external_llvm-67b453b0d1ed7ab42a9408a6eb00131e160eb421.tar.gz external_llvm-67b453b0d1ed7ab42a9408a6eb00131e160eb421.tar.bz2 |
Combine NEON VABD (absolute difference) intrinsics with ADDs to make VABA
(absolute difference with accumulate) intrinsics. Radar 8228576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 08054cb..92fb442 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -4248,12 +4248,28 @@ SDValue combineSelectAndUse(SDNode *N, SDValue Slct, SDValue OtherOp, /// operands. static SDValue PerformADDCombineWithOperands(SDNode *N, SDValue N0, SDValue N1, TargetLowering::DAGCombinerInfo &DCI) { + SelectionDAG &DAG = DCI.DAG; + // fold (add (select cc, 0, c), x) -> (select cc, x, (add, x, c)) if (N0.getOpcode() == ISD::SELECT && N0.getNode()->hasOneUse()) { SDValue Result = combineSelectAndUse(N, N0, N1, DCI); if (Result.getNode()) return Result; } + // fold (add (arm_neon_vabd a, b) c) -> (arm_neon_vaba c, a, b) + EVT VT = N->getValueType(0); + if (N0.getOpcode() == ISD::INTRINSIC_WO_CHAIN && VT.isInteger()) { + unsigned IntNo = cast<ConstantSDNode>(N0.getOperand(0))->getZExtValue(); + if (IntNo == Intrinsic::arm_neon_vabds) + return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, N->getDebugLoc(), VT, + DAG.getConstant(Intrinsic::arm_neon_vabas, MVT::i32), + N1, N0.getOperand(1), N0.getOperand(2)); + if (IntNo == Intrinsic::arm_neon_vabdu) + return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, N->getDebugLoc(), VT, + DAG.getConstant(Intrinsic::arm_neon_vabau, MVT::i32), + N1, N0.getOperand(1), N0.getOperand(2)); + } + return SDValue(); } |