diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-09-26 08:14:06 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-09-26 08:14:06 +0000 |
commit | 5f3e0af9d05652336e8f7e646e8e8f79c30171cf (patch) | |
tree | 1e60fda19bec3e88a84c367a56988565c4ef99e1 /llvm/lib | |
parent | b4a864d533d493f3aaf07cda01a6062dec947330 (diff) | |
download | bcm5719-llvm-5f3e0af9d05652336e8f7e646e8e8f79c30171cf.tar.gz bcm5719-llvm-5f3e0af9d05652336e8f7e646e8e8f79c30171cf.zip |
Wrong size for load
llvm-svn: 30610
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 93f8db12377..9a78459edef 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2644,6 +2644,8 @@ SDOperand DAGCombiner::visitLOAD(SDNode *N) { Chain.getOperand(1).getValueType() == N->getValueType(0)) return CombineTo(N, Chain.getOperand(1), Chain); + // We can only move the load if it has a user of it's chain result. Otherwise + // there is no place to attach it's old chain. if (CombinerAA && hasChainUsers(N)) { // Walk up chain skipping non-aliasing memory nodes. SDOperand BetterChain = FindBetterChain(N, Chain); @@ -3956,15 +3958,19 @@ SDOperand DAGCombiner::BuildUDIV(SDNode *N) { bool DAGCombiner::hasChainUsers(SDNode *Load) { // Don't even bother if the load only has one user (conservatively the value.) if (!Load->hasOneUse()) { - SDOperand Chain(Load, 1); + SDOperand Chain(Load, 1); // The load's chain result. + // For each user of the load. for (SDNode::use_iterator UI = Load->use_begin(), UE = Load->use_end(); UI != UE; ++UI) { + + // Chain will be the first operand. if ((*UI)->getOperand(0) == Chain) return true; } } + // No luck. return false; } @@ -4025,7 +4031,7 @@ void DAGCombiner::FindAliasInfo(SDNode *N, switch (N->getOpcode()) { case ISD::LOAD: Ptr = N->getOperand(1); - Size = MVT::getSizeInBits(N->getOperand(1).getValueType()) >> 3; + Size = MVT::getSizeInBits(N->getValueType(0)) >> 3; SrcValue = N->getOperand(2); break; case ISD::STORE: |