forked from banach-space/llvm-tutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDuplicateBB.ll
24 lines (18 loc) · 850 Bytes
/
DuplicateBB.ll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: opt -load %shlibdir/libRIV%shlibext -load %shlibdir/libDuplicateBB%shlibext -legacy-duplicate-bb -S %s | FileCheck %s
; RUN: opt -load-pass-plugin %shlibdir/libRIV%shlibext -load-pass-plugin %shlibdir/libDuplicateBB%shlibext -passes=duplicate-bb -S %s | FileCheck %s
; Verify that indeed the only BasicBlock in foo is duplcated. It's a trivial
; BasicBlock with only one terminator instruction (terminator instructions are
; not duplicated). In total, 1 BasicBlock is replaced with 4.
define i32 @foo(i32) {
ret i32 1
}
; CHECK-LABEL: foo
; CHECK-NEXT: lt-if-then-else-0:
; CHECK-NEXT: %1 = icmp eq i32 %0, 0
; CHECK: br i1 %1, label %lt-clone-1-0, label %lt-clone-2-0
; CHECK: lt-clone-1-0:
; CHECK-NEXT: br label %lt-tail-0
; CHECK: lt-clone-2-0:
; CHECK-NEXT: br label %lt-tail-0
; CHECK: lt-tail-0:
; CHECK-NEXT: ret i32 1