Commit 76fa457
committed
[IVDescriptors] Identify min/max recurrences in single pass.
This patch ties to extend the approach from
#141431 to all min/max
recurrence kinds.
This patch adds a new getMinMaxRecurrence that identifies all min/max
recurrences in a single pass. It starts at the backedge value of a phi
and tries to identify the kind of the min/max recurrences.
It then walks from the backedge value to its operands recursively until
it reaches out-of-loop values or the phi.
Then users of both the backedge value and all instructions in the chain
from backedge value to phi are checked.
This consolidates all logic to identify min/max recurrences to a single
function, and avoids the need to try to identify each min/max reduction
kind individually.1 parent 0fefa56 commit 76fa457
File tree
2 files changed
+180
-180
lines changed- llvm
- include/llvm/Analysis
- lib/Analysis
2 files changed
+180
-180
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 158 | | |
167 | 159 | | |
168 | 160 | | |
| |||
0 commit comments