llvm-project/llvm/test/Transforms/JumpThreading
Wei Mi eec5ba9fae Fix the issue that ComputeValueKnownInPredecessors only handles the case when
phi is on lhs of a comparison op.

For the following testcase,
L1:

  %t0 = add i32 %m, 7
  %t3 = icmp eq i32* %t2, null
  br i1 %t3, label %L3, label %L2

L2:

  %t4 = load i32, i32* %t2, align 4
  br label %L3

L3:

  %t5 = phi i32 [ %t0, %L1 ], [ %t4, %L2 ]
  %t6 = icmp eq i32 %t0, %t5
  br i1 %t6, label %L4, label %L5

We know if we go through the path L1 --> L3, %t6 should always be true. However
currently, if the rhs of the eq comparison is phi, JumpThreading fails to
evaluate %t6 to true. And we know that Instcombine cannot guarantee always
canonicalizing phi to the left hand side of the comparison operation according
to the operand priority comparison mechanism in instcombine. The patch handles
the case when rhs of the comparison op is a phi.

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

llvm-svn: 331266
2018-05-01 14:47:24 +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
and-and-cond.ll
and-cond.ll
assume-edge-dom.ll
assume.ll
basic.ll [JumpThreading] Don't restrict cast-traversal to i1 2018-03-09 16:43:46 +00:00
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
compare.ll
conservative-lvi.ll
crash.ll
ddt-crash.ll [JumpThreading] Preservation of DT and LVI across the pass 2018-01-12 21:06:48 +00:00
ddt-crash2.ll [JumpThreading] Preservation of DT and LVI across the pass 2018-01-12 21:06:48 +00:00
ddt-crash3.ll [Dominators] Visit affected node candidates found at different root levels 2018-01-19 21:27:24 +00:00
ddt-crash4.ll [Dominators] Visit affected node candidates found at different root levels 2018-01-19 21:27:24 +00:00
degenerate-phi.ll
fold-not-thread.ll
guards.ll [JumpThreading] Restrict PRE across instructions that don't pass control to successors 2017-12-19 09:10:21 +00:00
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 [JumpThreading] Preservation of DT and LVI across the pass 2018-01-12 21:06:48 +00:00
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 [JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis 2018-02-16 16:35:17 +00:00
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
threading_prof1.ll
threading_prof2.ll
update-edge-weight.ll