HomePhabricator

Model ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m

Description

Model ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m

Given below case:

%y = shl %x, n
%z = ashr %y, m

when n = m, SCEV models it as sext(trunc(x)). This patch tries to handle
the case where n > m by using sext(mul(trunc(x), 2^(n-m)))) as the SCEV
expression.

Details

Committed
zzhengMar 23 2017, 11:06 AM
Parents
rL298630: revert test commit r298629
Branches
Unknown
Tags
Unknown