From 42eeb1d91f66532c2aeba272c07c0eb813c0ca95 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Wed, 29 Apr 2015 16:30:46 +0000 Subject: [PATCH] CodeGen: Default overflow operations to expand so we don't have to assume targets are lying Signed-off-by: Jan Vesely Reviewed-by: ab Differential Revision: http://reviews.llvm.org/D9265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236119 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 ------ lib/CodeGen/TargetLoweringBase.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 14a691b75f0..9157bf32b2c 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1245,12 +1245,6 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) { break; case ISD::EXTRACT_ELEMENT: case ISD::FLT_ROUNDS_: - case ISD::SADDO: - case ISD::SSUBO: - case ISD::UADDO: - case ISD::USUBO: - case ISD::SMULO: - case ISD::UMULO: case ISD::FPOWI: case ISD::MERGE_VALUES: case ISD::EH_RETURN: diff --git a/lib/CodeGen/TargetLoweringBase.cpp b/lib/CodeGen/TargetLoweringBase.cpp index 8eb64643f13..4dd279ede0d 100644 --- a/lib/CodeGen/TargetLoweringBase.cpp +++ b/lib/CodeGen/TargetLoweringBase.cpp @@ -804,6 +804,14 @@ void TargetLoweringBase::initActions() { setOperationAction(ISD::FMAXNUM, VT, Expand); setOperationAction(ISD::FMAD, VT, Expand); + // Overflow operations default to expand + setOperationAction(ISD::SADDO, VT, Expand); + setOperationAction(ISD::SSUBO, VT, Expand); + setOperationAction(ISD::UADDO, VT, Expand); + setOperationAction(ISD::USUBO, VT, Expand); + setOperationAction(ISD::SMULO, VT, Expand); + setOperationAction(ISD::UMULO, VT, Expand); + // These library functions default to expand. setOperationAction(ISD::FROUND, VT, Expand); -- 2.34.1