mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 10:32:48 +02:00
implement missing SCEVDivision case
without this case we would end on an infinite recursion: the remainder is zero, so Numerator - Remainder is equal to Numerator and so we would recursively ask for the division of Numerator by Denominator. llvm-svn: 209838
This commit is contained in:
parent
a5d17facf7
commit
e038cb3e5a
@ -7216,6 +7216,15 @@ public:
|
||||
cast<SCEVConstant>(Zero)->getValue();
|
||||
Remainder = SCEVParameterRewriter::rewrite(Numerator, SE, RewriteMap, true);
|
||||
|
||||
if (Remainder->isZero()) {
|
||||
// The Quotient is obtained by replacing Denominator by 1 in Numerator.
|
||||
RewriteMap[cast<SCEVUnknown>(Denominator)->getValue()] =
|
||||
cast<SCEVConstant>(One)->getValue();
|
||||
Quotient =
|
||||
SCEVParameterRewriter::rewrite(Numerator, SE, RewriteMap, true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Quotient is (Numerator - Remainder) divided by Denominator.
|
||||
const SCEV *Q, *R;
|
||||
const SCEV *Diff = SE.getMinusSCEV(Numerator, Remainder);
|
||||
|
Loading…
Reference in New Issue
Block a user