Commit f41bbc5
committed
[ScalarEvolution] Handle addrec incoming value in isImpliedViaMerge()
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 #126012.1 parent ae08969 commit f41bbc5
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 | |
|---|---|---|---|
| |||
12400 | 12400 | | |
12401 | 12401 | | |
12402 | 12402 | | |
| 12403 | + | |
| 12404 | + | |
| 12405 | + | |
| 12406 | + | |
| 12407 | + | |
| 12408 | + | |
12403 | 12409 | | |
12404 | 12410 | | |
12405 | 12411 | | |
| |||
| 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