llvm.org GIT mirror llvm / 498f559
Forgot about chain result; also UNDEF cannot have multiple values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36622 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
1 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
33303330 // the updated indexed value in case of indexed loads), change uses of the
33313331 // chain value into uses of the chain input (i.e. delete the dead load).
33323332 if (!LD->isVolatile()) {
3333 bool HasUses = false;
3334 SmallVector VTs;
3335 for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {
3336 if (!N->hasNUsesOfValue(0, i)) {
3337 HasUses = true;
3338 break;
3333 if (N->getValueType(1) == MVT::Other) {
3334 // Unindexed loads.
3335 if (N->hasNUsesOfValue(0, 0))
3336 return CombineTo(N, DAG.getNode(ISD::UNDEF, N->getValueType(0)), Chain);
3337 } else {
3338 // Indexed loads.
3339 assert(N->getValueType(2) == MVT::Other && "Malformed indexed loads?");
3340 if (N->hasNUsesOfValue(0, 0) && N->hasNUsesOfValue(0, 1)) {
3341 SDOperand Undef0 = DAG.getNode(ISD::UNDEF, N->getValueType(0));
3342 SDOperand Undef1 = DAG.getNode(ISD::UNDEF, N->getValueType(1));
3343 SDOperand To[] = { Undef0, Undef1, Chain };
3344 return CombineTo(N, To, 3);
33393345 }
3340 VTs.push_back(N->getValueType(i));
3341 }
3342 if (!HasUses) {
3343 SmallVector Ops;
3344 return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size(), 0, 0),
3345 Chain);
33463346 }
33473347 }
33483348