mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user