diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2012-07-17 07:47:50 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2012-07-17 07:47:50 +0000 |
| commit | 47d7be9578808b416a5b212a9a1b456ddeee94b4 (patch) | |
| tree | cb2dcbf981725a09f490a83586d5a7fa52f77221 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 1ad8e98298ada7299c346bf67f59f8adc821bb9b (diff) | |
| download | bcm5719-llvm-47d7be9578808b416a5b212a9a1b456ddeee94b4.tar.gz bcm5719-llvm-47d7be9578808b416a5b212a9a1b456ddeee94b4.zip | |
Make sure constant bitwidth is <= 64 bit before calling getSExtValue().
llvm-svn: 160350
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 9902ed76fa7..d439a6f8699 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2323,7 +2323,8 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, } } - if (!isLegalICmpImmediate(C1.getSExtValue())) { + if (C1.getMinSignedBits() <= 64 && + !isLegalICmpImmediate(C1.getSExtValue())) { // (X & -256) == 256 -> (X >> 8) == 1 if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) && N0.getOpcode() == ISD::AND && N0.hasOneUse()) { |

