summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-05-06 14:03:12 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-05-06 14:03:12 +0000
commitd7c0be9c42e8c0f7ec844d5219ef51cbc5e1952a (patch)
treed719c3235b78d51744502953396e99994cdaee50 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent04785d04883b30b07899cb280829976fb5754497 (diff)
downloadbcm5719-llvm-d7c0be9c42e8c0f7ec844d5219ef51cbc5e1952a.tar.gz
bcm5719-llvm-d7c0be9c42e8c0f7ec844d5219ef51cbc5e1952a.zip
Revert r236546, "propagate IR-level fast-math-flags to DAG nodes (NFC)"
It caused undefined behavior. llvm-svn: 236600
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 575f4bd22b4..d0bda11eb05 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2139,8 +2139,6 @@ void SelectionDAGBuilder::visitBinary(const User &I, unsigned OpCode) {
bool nuw = false;
bool nsw = false;
bool exact = false;
- FastMathFlags FMF;
-
if (const OverflowingBinaryOperator *OFBinOp =
dyn_cast<const OverflowingBinaryOperator>(&I)) {
nuw = OFBinOp->hasNoUnsignedWrap();
@@ -2150,20 +2148,8 @@ void SelectionDAGBuilder::visitBinary(const User &I, unsigned OpCode) {
dyn_cast<const PossiblyExactOperator>(&I))
exact = ExactOp->isExact();
- if (const FPMathOperator *FPOp = dyn_cast<const FPMathOperator>(&I))
- FMF = FPOp->getFastMathFlags();
-
- SDNodeFlags Flags;
- Flags.setAllowReciprocal(FMF.allowReciprocal());
- Flags.setExact(exact);
- Flags.setNoInfs(FMF.noInfs());
- Flags.setNoNaNs(FMF.noNaNs());
- Flags.setNoSignedWrap(nsw);
- Flags.setNoSignedZeros(FMF.noSignedZeros());
- Flags.setNoUnsignedWrap(nuw);
- Flags.setUnsafeAlgebra(FMF.unsafeAlgebra());
SDValue BinNodeValue = DAG.getNode(OpCode, getCurSDLoc(), Op1.getValueType(),
- Op1, Op2, &Flags);
+ Op1, Op2, nuw, nsw, exact);
setValue(&I, BinNodeValue);
}
@@ -2212,12 +2198,8 @@ void SelectionDAGBuilder::visitShift(const User &I, unsigned Opcode) {
exact = ExactOp->isExact();
}
- SDNodeFlags Flags;
- Flags.setExact(exact);
- Flags.setNoSignedWrap(nsw);
- Flags.setNoUnsignedWrap(nuw);
SDValue Res = DAG.getNode(Opcode, getCurSDLoc(), Op1.getValueType(), Op1, Op2,
- &Flags);
+ nuw, nsw, exact);
setValue(&I, Res);
}
OpenPOWER on IntegriCloud