Commit af970cd
[ScalarEvolution] Handle addrec incoming value in isImpliedViaMerge() (llvm#126236)
The code already guards against values coming from a previous iteration
using properlyDominates(). However, addrecs are considered to properly
dominate the loop they are defined in.
Handle this special case separately, by checking for expressions that
have computable loop evolution (this should cover cases like a zext of
an addrec as well).
I considered changing the definition of properlyDominates() instead, but
decided against it. The current definition is useful in other context,
e.g. when deciding whether an expression is safe to expand in a given
block.
Fixes llvm#126012.
(cherry picked from commit 7aed53e)1 parent 9bbf3a9 commit af970cd
File tree
2 files changed
+13
-3
lines changed- llvm
- lib/Analysis
- test/Transforms/IndVarSimplify
2 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12402 | 12402 | | |
12403 | 12403 | | |
12404 | 12404 | | |
| 12405 | + | |
| 12406 | + | |
| 12407 | + | |
| 12408 | + | |
| 12409 | + | |
| 12410 | + | |
12405 | 12411 | | |
12406 | 12412 | | |
12407 | 12413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
0 commit comments