OSDN Git Service

SCEVExpander: Try hard not to create derived induction variables in other loops
authorArnold Schwaighofer <aschwaighofer@apple.com>
Sat, 15 Feb 2014 17:11:56 +0000 (17:11 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Sat, 15 Feb 2014 17:11:56 +0000 (17:11 +0000)
commite67254860230c58a5de34578354a4d1d78c87e83
treefd08513cbe9cebcc9f8622d8a725275294201eee
parent4b3ec1763c22130fb91380413a8c3ddbdf044c3e
SCEVExpander: Try hard not to create derived induction variables in other loops

During LSR of one loop we can run into a situation where we have to expand the
start of a recurrence of a loop induction variable in this loop. This start
value is a value derived of the induction variable of a preceeding loop. SCEV
has cannonicalized this value to a different recurrence than the recurrence of
the preceeding loop's induction variable (the type and/or step direction) has
changed). When we come to instantiate this SCEV we created a second induction
variable in this preceeding loop.  This patch tries to base such derived
induction variables of the preceeding loop's induction variable.

This helps twolf on arm and seems to help scimark2 on x86.

radar://15970709

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201465 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp
test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll [new file with mode: 0644]