mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Recognize n/1 in the SCEV divide function
n/1 generates a quotient equal to n and a remainder of 0. If this case is not recognized, then the SCEV divide() function can return a remainder that is greater than or equal to the denominator, which means the delinearized subscripts for the test case will be incorrect. Differential Revision: http://reviews.llvm.org/D9003 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -726,6 +726,13 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// A simple case when N/1. The quotient is N.
|
||||
if (Denominator->isOne()) {
|
||||
*Quotient = Numerator;
|
||||
*Remainder = D.Zero;
|
||||
return;
|
||||
}
|
||||
|
||||
// Split the Denominator when it is a product.
|
||||
if (const SCEVMulExpr *T = dyn_cast<const SCEVMulExpr>(Denominator)) {
|
||||
const SCEV *Q, *R;
|
||||
|
||||
Reference in New Issue
Block a user