summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-14 19:25:30 +0000
committerChris Lattner <sabre@nondot.org>2005-12-14 19:25:30 +0000
commitd39c60fcc80b458d1bc6fd9e697f104098809bcb (patch)
treec0efaa659506e0af0bb9ce7485ac875ab319b207 /llvm/lib/CodeGen
parenteaee560c96ec4396c9f72dfb21d73b0e3b3bd91f (diff)
downloadbcm5719-llvm-d39c60fcc80b458d1bc6fd9e697f104098809bcb.tar.gz
bcm5719-llvm-d39c60fcc80b458d1bc6fd9e697f104098809bcb.zip
When folding loads into ops, immediately replace uses of the op with the
load. This reduces number of worklist iterations and avoid missing optimizations depending on folding of things into sext_inreg nodes (which aren't supported by all targets). Tested by Regression/CodeGen/X86/extend.ll:test2 llvm-svn: 24712
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 8077709c94a..031bf61c746 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1554,7 +1554,7 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
N0.getValueType());
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
ExtLoad.getValue(1));
return SDOperand();
@@ -1567,7 +1567,7 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
SDOperand ExtLoad = DAG.getNode(ISD::SEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
N0.getOperand(3));
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
ExtLoad.getValue(1));
return SDOperand();
@@ -1596,7 +1596,7 @@ SDOperand DAGCombiner::visitZERO_EXTEND(SDNode *N) {
SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
N0.getValueType());
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
ExtLoad.getValue(1));
return SDOperand();
@@ -1609,7 +1609,7 @@ SDOperand DAGCombiner::visitZERO_EXTEND(SDNode *N) {
SDOperand ExtLoad = DAG.getNode(ISD::ZEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
N0.getOperand(3));
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
ExtLoad.getValue(1));
return SDOperand();
@@ -1673,7 +1673,7 @@ SDOperand DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
EVT);
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
return SDOperand();
}
@@ -1684,7 +1684,7 @@ SDOperand DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
N0.getOperand(1), N0.getOperand(2),
EVT);
- WorkList.push_back(N);
+ CombineTo(N, ExtLoad);
CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
return SDOperand();
}
OpenPOWER on IntegriCloud