summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-02-11 00:50:23 +0000
committerWei Mi <wmi@google.com>2017-02-11 00:50:23 +0000
commit8f20e63a20b1624e3f7b8c4045b9d44bdc2bbc8f (patch)
tree8b0480546c5d21a145eacb8e6b17ad056c3ac5cc /clang
parentd3a6c897ba992e572ebecd2bcfe66cd2b435246e (diff)
downloadbcm5719-llvm-8f20e63a20b1624e3f7b8c4045b9d44bdc2bbc8f.tar.gz
bcm5719-llvm-8f20e63a20b1624e3f7b8c4045b9d44bdc2bbc8f.zip
[LSR] Recommit: Allow formula containing Reg for SCEVAddRecExpr related with outerloop.
The recommit includes some changes of testcases. No functional change to the patch. In RateRegister of existing LSR, if a formula contains a Reg which is a SCEVAddRecExpr, and this SCEVAddRecExpr's loop is an outerloop, the formula will be marked as Loser and dropped. Suppose we have an IR that %for.body is outerloop and %for.body2 is innerloop. LSR only handle inner loop now so only %for.body2 will be handled. Using the logic above, formula like reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) will be dropped no matter what because reg({1,+, %size}<%for.body>) is a SCEVAddRecExpr type reg related with outerloop. Only formula like reg(%array) + 1*reg({{1,+, %size}<%for.body>,+,1}<nuw><nsw><%for.body2>) will be kept because the SCEVAddRecExpr related with outerloop is folded into the initial value of the SCEVAddRecExpr related with current loop. But in some cases, we do need to share the basic induction variable reg{0 ,+, 1}<%for.body2> among LSR Uses to reduce the final total number of induction variables used by LSR, so we don't want to drop the formula like reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) unconditionally. From the existing comment, it tries to avoid considering multiple level loops at the same time. However, existing LSR only handles innermost loop, so for any SCEVAddRecExpr with a loop other than current loop, it is an invariant and will be simple to handle, and the formula doesn't have to be dropped. Differential Revision: https://reviews.llvm.org/D26429 llvm-svn: 294814
Diffstat (limited to 'clang')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud