summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-02-16 21:27:31 +0000
committerWei Mi <wmi@google.com>2017-02-16 21:27:31 +0000
commit493fb266ed8eb3e2de4c9d5013c9870d555948dc (patch)
tree70761a8622c2bc133f15e7a862e1bcbfdf621ef7 /llvm/tools
parentfc4857f80ba83c33358ec28cd10f6db1b77d90c4 (diff)
downloadbcm5719-llvm-493fb266ed8eb3e2de4c9d5013c9870d555948dc.tar.gz
bcm5719-llvm-493fb266ed8eb3e2de4c9d5013c9870d555948dc.zip
[LSR] Prevent formula with SCEVAddRecExpr type of Reg from Sibling loops
In rL294814, we allow formula with SCEVAddRecExpr type of Reg from loops other than current loop. This is good for the case when induction variable of outerloop being used in expr in innerloop. But it is very bad to allow such Reg from sibling loop because we may need to add lsr.iv in other sibling loops when scev expanding those SCEVAddRecExpr type exprs. For the testcase below, one loop can be inserted with a bunch of lsr.iv because of LSR for other loops. // The induction variable j from a loop in the middle will have initial // value generated from previous sibling loop and exit value used by its // next sibling loop. void goo(long i, long j); long cond; void foo(long N) { long i = 0; long j = 0; i = 0; do { goo(i, j); i++; j++; } while (cond); i = 0; do { goo(i, j); i++; j++; } while (cond); i = 0; do { goo(i, j); i++; j++; } while (cond); i = 0; do { goo(i, j); i++; j++; } while (cond); i = 0; do { goo(i, j); i++; j++; } while (cond); i = 0; do { goo(i, j); i++; j++; } while (cond); } The fix is to only allow formula with SCEVAddRecExpr type of Reg from current loop or its parents. Differential Revision: https://reviews.llvm.org/D30021 llvm-svn: 295378
Diffstat (limited to 'llvm/tools')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud