summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.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/DAGCombiner.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/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c063d4f9a38..bf42aabeab2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1452,9 +1452,12 @@ SDValue DAGCombiner::combine(SDNode *N) {
if (isa<ConstantSDNode>(N0) || !isa<ConstantSDNode>(N1)) {
SDValue Ops[] = {N1, N0};
SDNode *CSENode;
- if (auto *FlagsNode = dyn_cast<SDNodeWithFlags>(N)) {
- CSENode = DAG.getNodeIfExists(N->getOpcode(), N->getVTList(),
- Ops, &FlagsNode->Flags);
+ if (const BinaryWithFlagsSDNode *BinNode =
+ dyn_cast<BinaryWithFlagsSDNode>(N)) {
+ CSENode = DAG.getNodeIfExists(N->getOpcode(), N->getVTList(), Ops,
+ BinNode->Flags.hasNoUnsignedWrap(),
+ BinNode->Flags.hasNoSignedWrap(),
+ BinNode->Flags.hasExact());
} else {
CSENode = DAG.getNodeIfExists(N->getOpcode(), N->getVTList(), Ops);
}
OpenPOWER on IntegriCloud