summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2014-04-22 01:20:34 +0000
committerQuentin Colombet <qcolombet@apple.com>2014-04-22 01:20:34 +0000
commitd4f44690ef8a9ae5b01b69205cf27572c75eaa66 (patch)
tree9ef687155ecab13a32d08e511a2fa16fba072dc7 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parente334c017737de0a1127a5cd70e99df198f9227b1 (diff)
downloadbcm5719-llvm-d4f44690ef8a9ae5b01b69205cf27572c75eaa66.tar.gz
bcm5719-llvm-d4f44690ef8a9ae5b01b69205cf27572c75eaa66.zip
[CodeGenPrepare] Use APInt to check the value of the immediate in a and
while checking candidate for bit field extract. Otherwise the value may not fit in uint64_t and this will trigger an assertion. This fixes PR19503. llvm-svn: 206834
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 27fdd5187bd..573e3d7b8cd 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -639,9 +639,9 @@ bool isExtractBitsCandidateUse(Instruction *User) {
!isa<ConstantInt>(User->getOperand(1)))
return false;
- unsigned Cimm = dyn_cast<ConstantInt>(User->getOperand(1))->getZExtValue();
+ const APInt &Cimm = cast<ConstantInt>(User->getOperand(1))->getValue();
- if (Cimm & (Cimm + 1))
+ if ((Cimm & (Cimm + 1)).getBoolValue())
return false;
}
return true;
OpenPOWER on IntegriCloud