summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-05-16 18:47:58 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-05-16 18:47:58 +0000
commitfc88c3761f18a8b92d4e42a8275807499c2147f6 (patch)
tree2dd1b1c9df5f5650a578a291a997e201b726a1e1 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent21bab5badc9836226312e389c56c28362b96f959 (diff)
downloadbcm5719-llvm-fc88c3761f18a8b92d4e42a8275807499c2147f6.tar.gz
bcm5719-llvm-fc88c3761f18a8b92d4e42a8275807499c2147f6.zip
DAGCombine: Also shrink eq compares where the constant is exactly as large as the smaller type.
if ((x & 255) == 255) before: movzbl %al, %eax cmpl $255, %eax after: cmpb $-1, %al llvm-svn: 182038
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index f5fc66c4d3d..95c327c8b05 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1160,7 +1160,7 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
}
// Make sure we're not losing bits from the constant.
- if (MinBits < C1.getBitWidth() && MinBits > C1.getActiveBits()) {
+ if (MinBits < C1.getBitWidth() && MinBits >= C1.getActiveBits()) {
EVT MinVT = EVT::getIntegerVT(*DAG.getContext(), MinBits);
if (isTypeDesirableForOp(ISD::SETCC, MinVT)) {
// Will get folded away.
OpenPOWER on IntegriCloud