mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
Fix an unequal bitwidth issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2dceea3f3
commit
9b4aeb3cc1
@ -1341,9 +1341,12 @@ static APInt GetConstantFactor(SCEVHandle S) {
|
||||
return APInt(C->getBitWidth(), 1).shl(C->getBitWidth()-1);
|
||||
}
|
||||
|
||||
if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S))
|
||||
return GetConstantFactor(T->getOperand()) &
|
||||
cast<IntegerType>(T->getType())->getMask();
|
||||
if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S)) {
|
||||
APInt Mask(cast<IntegerType>(T->getType())->getMask());
|
||||
APInt GCF(GetConstantFactor(T->getOperand()));
|
||||
Mask.zextOrTrunc(GCF.getBitWidth());
|
||||
return GCF & Mask;
|
||||
}
|
||||
if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S))
|
||||
return GetConstantFactor(E->getOperand());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user