diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-06-20 15:42:48 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-06-20 15:42:48 +0000 |
commit | 8a31138521a1e457a5b1ac399c40e2b32b4dd033 (patch) | |
tree | 1d6fbb39c52f3e6b61dd1ac3783b7cc4b89ee8e4 | |
parent | 98390d0b71bd5bda577b43e087683fb1d05c0246 (diff) | |
download | bcm5719-llvm-8a31138521a1e457a5b1ac399c40e2b32b4dd033.tar.gz bcm5719-llvm-8a31138521a1e457a5b1ac399c40e2b32b4dd033.zip |
Fix DAGCombine to deal with ext-conversion of pre/post_inc loads.
The test case for this will come with the PPC indexed preinc loads commit.
llvm-svn: 158822
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 3517b7cfbe3..4b56e41b72c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2524,7 +2524,14 @@ SDValue DAGCombiner::visitAND(SDNode *N) { Load->getOffset(), Load->getMemoryVT(), Load->getMemOperand()); // Replace uses of the EXTLOAD with the new ZEXTLOAD. - CombineTo(Load, NewLoad.getValue(0), NewLoad.getValue(1)); + if (Load->getNumValues() == 3) { + // PRE/POST_INC loads have 3 values. + SDValue To[] = { NewLoad.getValue(0), NewLoad.getValue(1), + NewLoad.getValue(2) }; + CombineTo(Load, To, 3, true); + } else { + CombineTo(Load, NewLoad.getValue(0), NewLoad.getValue(1)); + } } // Fold the AND away, taking care not to fold to the old load node if we |