summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-05-25 18:47:23 +0000
committerDale Johannesen <dalej@apple.com>2010-05-25 18:47:23 +0000
commit60fe2cdc4f03d2aeee40dcbd477d26a8e9209952 (patch)
tree4c0e8c5e27c077572238666025d75b1fda3f088c /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent4c77a6439150e7c3d3b7f9e9675e5fd81efa6ef0 (diff)
downloadbcm5719-llvm-60fe2cdc4f03d2aeee40dcbd477d26a8e9209952.tar.gz
bcm5719-llvm-60fe2cdc4f03d2aeee40dcbd477d26a8e9209952.zip
Fix another variant of PR 7191. Also add a testcase
Mon Ping provided; unfortunately bugpoint failed to reduce it, but I think it's important to have a test for this in the suite. 8023512. llvm-svn: 104624
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index df1a0a353ee..6bddd784fe8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3832,8 +3832,12 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
if (N0.getOpcode() == ISD::TRUNCATE) {
SDValue NarrowLoad = ReduceLoadWidth(N0.getNode());
if (NarrowLoad.getNode()) {
- if (NarrowLoad.getNode() != N0.getNode())
+ SDNode* oye = N0.getNode()->getOperand(0).getNode();
+ if (NarrowLoad.getNode() != N0.getNode()) {
CombineTo(N0.getNode(), NarrowLoad);
+ // CombineTo deleted the truncate, if needed, but not what's under it.
+ AddToWorkList(oye);
+ }
return DAG.getNode(ISD::ANY_EXTEND, N->getDebugLoc(), VT, NarrowLoad);
}
}
OpenPOWER on IntegriCloud