diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-14 21:26:58 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-14 21:26:58 +0000 |
commit | cf2da96c82e6488d382ba320b4749e1c5d6c62f8 (patch) | |
tree | 796f1b05477b7113e50c5e862d0af1deadd7786a /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | 5957a1963056e7fbbf978c0519f1fa4ac94767ba (diff) | |
download | bcm5719-llvm-cf2da96c82e6488d382ba320b4749e1c5d6c62f8.tar.gz bcm5719-llvm-cf2da96c82e6488d382ba320b4749e1c5d6c62f8.zip |
[SelectionDAG] Add a signed integer absolute ISD node
Reduced version of D26357 - based on the discussion on llvm-dev about canonicalization of UMIN/UMAX/SMIN/SMAX as well as ABS I've reduced that patch to just the ABS ISD node (with x86/sse support) to improve basic combines and lowering.
ARM/AArch64, Hexagon, PowerPC and NVPTX all have similar instructions allowing us to make this a generic opcode and move away from the hard coded tablegen patterns which makes it tricky to match more complex patterns.
At the moment this patch doesn't attempt legalization as we only create an ABS node if its legal/custom.
Differential Revision: https://reviews.llvm.org/D29639
llvm-svn: 297780
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 518417dd11e..7a2d50e63c5 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -900,6 +900,7 @@ void TargetLoweringBase::initActions() { setOperationAction(ISD::SMAX, VT, Expand); setOperationAction(ISD::UMIN, VT, Expand); setOperationAction(ISD::UMAX, VT, Expand); + setOperationAction(ISD::ABS, VT, Expand); // Overflow operations default to expand setOperationAction(ISD::SADDO, VT, Expand); |