1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/test/Transforms/JumpThreading/ddt-crash2.ll
Brian M. Rzycki 504eb62dfb [JumpThreading] Preservation of DT and LVI across the pass
Summary:
See D37528 for a previous (non-deferred) version of this
patch and its description.

Preserves dominance in a deferred manner using a new class
DeferredDominance. This reduces the performance impact of
updating the DominatorTree at every edge insertion and
deletion. A user may call DDT->flush() within JumpThreading
for an up-to-date DT. This patch currently has one flush()
at the end of runImpl() to ensure DT is preserved across
the pass.

LVI is also preserved to help subsequent passes such as
CorrelatedValuePropagation. LVI is simpler to maintain and
is done immediately (not deferred). The code to perform the
preversation was minimally altered and simply marked as
preserved for the PassManager to be informed.

This extends the analysis available to JumpThreading for
future enhancements such as threading across loop headers.

Reviewers: dberlin, kuhar, sebpop

Reviewed By: kuhar, sebpop

Subscribers: mgorny, dmgreen, kuba, rnk, rsmith, hiraditya, llvm-commits

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

llvm-svn: 322401
2018-01-12 21:06:48 +00:00

41 lines
870 B
LLVM

; RUN: opt < %s -jump-threading -disable-output
%struct.aaa = type { i8 }
define void @chrome(%struct.aaa* noalias sret %arg) local_unnamed_addr #0 align 2 personality i8* bitcast (i32 (...)* @chrome2 to i8*) {
bb:
%tmp = load i32, i32* undef, align 4
%tmp1 = icmp eq i32 %tmp, 0
br i1 %tmp1, label %bb2, label %bb13
bb2:
%tmp3 = getelementptr inbounds %struct.aaa, %struct.aaa* %arg, i64 0, i32 0
%tmp4 = load i8, i8* %tmp3, align 1
%tmp5 = icmp eq i8 %tmp4, 0
br i1 %tmp5, label %bb6, label %bb7
bb6:
store i8 0, i8* %tmp3, align 1
br label %bb7
bb7:
%tmp8 = load i8, i8* %tmp3, align 1
%tmp9 = icmp ne i8 %tmp8, 0
%tmp10 = select i1 %tmp9, i1 true, i1 false
br i1 %tmp10, label %bb12, label %bb11
bb11:
br label %bb12
bb12:
br i1 %tmp9, label %bb14, label %bb13
bb13:
unreachable
bb14:
ret void
}
declare i32 @chrome2(...)