llvm-mirror/test/Transforms/SimplifyCFG/hoist-with-range.ll
Roman Lebedev 39a69897ce [NFCI][SimplifyCFG] Guard common code hoisting with a (default-on) flag
Common code sinking is already guarded with a (with default-off!) flag,
so add a flag for hoisting, too.

D84108 will hopefully make hoisting off-by-default too.
2020-07-20 10:29:57 +03:00

21 lines
424 B
LLVM

; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
define void @foo(i1 %c, i8* %p) {
; CHECK: if:
; CHECK-NEXT: load i8, i8* %p, align 1, !range !0
; CHECK: !0 = !{i8 0, i8 1, i8 3, i8 5}
if:
br i1 %c, label %then, label %else
then:
%t = load i8, i8* %p, !range !0
br label %out
else:
%e = load i8, i8* %p, !range !1
br label %out
out:
ret void
}
!0 = !{ i8 0, i8 1 }
!1 = !{ i8 3, i8 5 }