llvm-project/llvm/test/Transforms/JumpThreading
Florian Hahn fc7654a67b [Local] Keep K's range if K does not move when combining metadata.
As K has to dominate I, IIUC I's range metadata must be a subset of
K's. After Eli's recent clarification to the LangRef, loading a value
outside of the range is undefined behavior.
Therefore if I's range contains elements outside of K's range and we would load
one such value, K would cause undefined behavior.

In cases like hoisting/sinking, we still want the most generic range
over all code paths to/from the hoist/sink point. As suggested in the
patches related to D47339, I will refactor the handling of those
scenarios and try to decouple it from this function as follow up, once
we switched to a similar handling of metadata in most of
combineMetadata.

I updated some tests checking mostly the merging of metadata to keep the
metadata of to dominating load. The most interesting one is probably test8 in
test/Transforms/JumpThreading/thread-loads.ll. It contained a comment
about the alias metadata preventing us to eliminate the branch, but it
seem like the actual problem currently is that we merge the ranges of
both loads and cannot eliminate the icmp afterwards. With this patch, we
manage to eliminate the icmp, as the range of the first load excludes 8.

Reviewers: efriedma, nlopes, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D51629

llvm-svn: 345456
2018-10-27 16:53:45 +00:00
..
2008-11-27-EntryMunge.ll
2010-08-26-and.ll
2011-04-02-SimplifyDeadBlock.ll
2011-04-14-InfLoop.ll
2012-07-19-NoSuccessorIndirectBr.ll
PR33357-lvi-recursion.ll [LazyValueInfo] PR33357 prevent infinite recursion on BinaryOperator 2018-03-13 18:14:10 +00:00
PR37745.ll [JumpThreading] Don't try to rewrite a use if it's already valid. 2018-06-26 22:19:48 +00:00
and-and-cond.ll
and-cond.ll
assume-edge-dom.ll
assume.ll
basic.ll
bb-unreachable-from-entry.ll [SSAUpdaterBulk] Handle CFG with unreachable from entry blocks. 2018-04-10 02:16:29 +00:00
branch-no-const.ll
combine-metadata.ll [Local] Make DoesKMove required for combineMetadata. 2018-08-24 11:40:04 +00:00
compare.ll
conservative-lvi.ll
crash.ll
ddt-crash.ll
ddt-crash2.ll
ddt-crash3.ll
ddt-crash4.ll
degenerate-phi.ll
fold-not-thread.ll
guards.ll
header-succ.ll [JumpThreading] Don't select an edge that we know we can't thread 2018-03-29 16:01:26 +00:00
implied-cond.ll
indirectbr.ll
induction.ll
landing-pad.ll
lvi-load.ll
lvi-tristate.ll
no-irreducible-loops.ll
or-undef.ll
phi-eq.ll
phi-known.ll Fix the issue that ComputeValueKnownInPredecessors only handles the case when 2018-05-01 14:47:24 +00:00
pr9331.ll
pr15851_hang.ll [JumpThreading] Track unreachable BBs to avoid processing 2018-03-16 15:13:47 +00:00
pr22086.ll
pr26096.ll
pr27840.ll
pr33605.ll
pr33917.ll
pr36133.ll
range-compare.ll
removed-use.ll Fix typo in a test. 2018-04-20 13:51:36 +00:00
select.ll [JumpThreading] Track unreachable BBs to avoid processing 2018-03-16 15:13:47 +00:00
static-profile.ll
thread-cmp.ll
thread-loads.ll [Local] Keep K's range if K does not move when combining metadata. 2018-10-27 16:53:45 +00:00
threading_prof1.ll
threading_prof2.ll
update-edge-weight.ll