1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/IRCE
Florian Hahn df7e45dd98 [SCEV] By more careful when traversing phis in isImpliedViaMerge.
I think currently isImpliedViaMerge can incorrectly return true for phis
in a loop/cycle, if the found condition involves the previous value of

Consider the case in exit_cond_depends_on_inner_loop.

At some point, we call (modulo simplifications)
isImpliedViaMerge(<=, %x.lcssa, -1, %call, -1).

The existing code tries to prove IncV <= -1 for all incoming values
InvV using the found condition (%call <= -1). At the moment this succeeds,
but only because it does not compare the same runtime value. The found
condition checks the value of the last iteration, but the incoming value
is from the *previous* iteration.

Hence we incorrectly determine that the *previous* value was <= -1,
which may not be true.

I think we need to be more careful when looking at the incoming values
here. In particular, we need to rule out that a found condition refers to
any value that may refer to one of the previous iterations. I'm not sure
there's a reliable way to do so (that also works of irreducible control
flow).

So for now this patch adds an additional requirement that the incoming
value must properly dominate the phi block. This should ensure the
values do not change in a cycle. I am not entirely sure if will catch
all cases and I appreciate a through second look in that regard.

Alternatively we could also unconditionally bail out in this case,
instead of checking the incoming values

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101829
2021-05-07 19:52:29 +01:00
..
add-metadata-pre-post-loops.ll
bad_expander.ll
bad-loop-structure.ll
bug-loop-varying-upper-limit.ll
bug-mismatched-types.ll
clamp.ll
conjunctive-checks.ll
correct-loop-info.ll
decrementing-loop.ll [SCEV] By more careful when traversing phis in isImpliedViaMerge. 2021-05-07 19:52:29 +01:00
empty_ranges.ll
eq_ne.ll
low-becount.ll
low-iterations.ll
multiple-access-no-preloop.ll
non_known_positive_end.ll
non-loop-invariant-rhs-instr.ll
not-likely-taken.ll
only-lower-check.ll
only-upper-check.ll
optimistic_scev.ll
pr48051.ll
pre_post_loops.ll
range_intersect_miscompile.ll
ranges_of_different_types.ll
rc-negative-bound.ll
single-access-no-preloop.ll
single-access-with-preloop.ll
skip-profitability-checks.ll
stride_more_than_1.ll
unhandled.ll
unsigned_comparisons_ugt.ll
unsigned_comparisons_ult.ll
variable-loop-bounds.ll
wide_indvar.ll
with-parent-loops.ll