diff options
| author | Pawel Bylica <chfast@gmail.com> | 2015-06-22 15:58:11 +0000 |
|---|---|---|
| committer | Pawel Bylica <chfast@gmail.com> | 2015-06-22 15:58:11 +0000 |
| commit | 06407c032038c6c3c3776fcb9ad8b06729e0c1d8 (patch) | |
| tree | 19df6c28ae0b6543ea14c919a2d9cdec1151eb8f /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
| parent | 7be075335dca4f9b2a325a39b9a5a363ea7c6327 (diff) | |
| download | bcm5719-llvm-06407c032038c6c3c3776fcb9ad8b06729e0c1d8.tar.gz bcm5719-llvm-06407c032038c6c3c3776fcb9ad8b06729e0c1d8.zip | |
Fix shl folding in DAG combiner.
Summary: The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.
Test Plan: A regression test included.
Reviewers: andreadb
Reviewed By: andreadb
Subscribers: andreadb, test, llvm-commits
Differential Revision: http://reviews.llvm.org/D10602
llvm-svn: 240291
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index bc2e5f13d43..80a1b5b3be7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4275,7 +4275,7 @@ SDValue DAGCombiner::visitSHL(SDNode *N) { if (isNullConstant(N0)) return N0; // fold (shl x, c >= size(x)) -> undef - if (N1C && N1C->getZExtValue() >= OpSizeInBits) + if (N1C && N1C->getAPIntValue().uge(OpSizeInBits)) return DAG.getUNDEF(VT); // fold (shl x, 0) -> x if (N1C && N1C->isNullValue()) |

