1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Change the testcase tail-merge-after-mbp.ll to tail-merge-after-mbp.mir

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

llvm-svn: 300506
This commit is contained in:
Haicheng Wu 2017-04-17 22:22:38 +00:00
parent bec88c1d46
commit b656bd13b8
2 changed files with 105 additions and 94 deletions

View File

@ -1,94 +0,0 @@
; RUN: llc -mtriple=x86_64-linux -o - %s | FileCheck %s
%0 = type { %1, %3* }
%1 = type { %2* }
%2 = type { %2*, i8* }
%3 = type { i32, i32 (i32, i32)* }
declare i32 @Up(...)
declare i32 @f(i32, i32)
; check loop block_14 is not merged with block_21
; check loop block_11 is not merged with block_18, block_25
define i32 @foo(%0* nocapture readonly, i32, i1 %c, i8* %p1, %2** %p2) {
; CHECK-LABEL: foo:
; CHECK: # %block_11
; CHECK-NEXT: movq (%r14), %rax
; CHECK-NEXT: testq %rax, %rax
; CHECK-NEXT: je
; CHECK-NEXT:# %block_14
; CHECK-NEXT: cmpq $0, 8(%rax)
; CHECK-NEXT: jne
; CHECK-NEXT:# %block_18
; CHECK-NEXT: movq (%r14), %rax
; CHECK-NEXT: testq %rax, %rax
; CHECK-NEXT: je
; CHECK-NEXT:# %block_21
; CHECK-NEXT:# =>This Inner Loop Header
; CHECK-NEXT: cmpq $0, 8(%rax)
; CHECK-NEXT: jne
; CHECK-NEXT:# %block_25
; CHECK-NEXT:# in Loop
; CHECK-NEXT: movq (%r14), %rax
; CHECK-NEXT: testq %rax, %rax
; CHECK-NEXT: jne
br i1 %c, label %block_34, label %block_3
block_3: ; preds = %2
br i1 %c, label %block_7, label %block_4
block_4: ; preds = %block_3
%a5 = tail call i32 @f(i32 undef, i32 undef)
%a6 = icmp eq i32 %a5, 0
br i1 %a6, label %block_7, label %block_34
block_7: ; preds = %block_4, %block_3
%a8 = icmp eq %2* null, null
br i1 %a8, label %block_34, label %block_9
block_9: ; preds = %block_7
%a10 = icmp eq i8* %p1, null
br i1 %a10, label %block_11, label %block_32
block_11: ; preds = %block_9
%a12 = load %2*, %2** %p2, align 8
%a13 = icmp eq %2* %a12, null
br i1 %a13, label %block_34, label %block_14
block_14: ; preds = %block_11
%a15 = getelementptr inbounds %2, %2* %a12, i64 0, i32 1
%a16 = load i8*, i8** %a15, align 8
%a17 = icmp eq i8* %a16, null
br i1 %a17, label %block_18, label %block_32
block_18: ; preds = %block_14
%a19 = load %2*, %2** %p2, align 8
%a20 = icmp eq %2* %a19, null
br i1 %a20, label %block_34, label %block_21
block_21: ; preds = %block_18
%a22 = getelementptr inbounds %2, %2* %a19, i64 0, i32 1
%a23 = load i8*, i8** %a22, align 8
%a24 = icmp eq i8* %a23, null
br i1 %a24, label %block_25, label %block_32
block_25: ; preds = %block_28, %block_21
%a26 = load %2*, %2** %p2, align 8
%a27 = icmp eq %2* %a26, null
br i1 %a27, label %block_34, label %block_28
block_28: ; preds = %block_25
%a29 = getelementptr inbounds %2, %2* %a26, i64 0, i32 1
%a30 = load i8*, i8** %a29, align 8
%a31 = icmp eq i8* %a30, null
br i1 %a31, label %block_25, label %block_32
block_32: ; preds = %block_28, %block_21, %block_14, %block_9
%a33 = tail call i32 (...) @Up()
br label %block_34
block_34: ; preds = %block_32, %block_25, %block_18, %block_11, %block_7, %block_4, %2
%a35 = phi i32 [ 0, %2 ], [ %a5, %block_4 ], [ 0, %block_7 ], [ 0, %block_11 ], [ 0, %block_32 ], [ 0, %block_18 ], [ 0, %block_25 ]
ret i32 %a35
}

View File

@ -0,0 +1,105 @@
# RUN: llc -mtriple=x86_64-linux -run-pass=block-placement -o - %s | FileCheck %s
---
# check loop bb.7 is not merged with bb.10, bb.13
# check loop bb.9 is not merged with bb.12
# CHECK: bb.2:
# CHECK-NEXT: successors: %bb.9(0x30000000), %bb.3(0x50000000)
# CHECK: %rax = MOV64rm %r14, 1, _, 0, _
# CHECK-NEXT: TEST64rr %rax, %rax
# CHECK-NEXT: JE_1 %bb.9
# CHECK: bb.3:
# CHECK-NEXT: successors: %bb.4(0x30000000), %bb.8(0x50000000)
# CHECK: CMP64mi8 killed %rax, 1, _, 8, _, 0
# CHECK-NEXT: JNE_1 %bb.8
# CHECK: bb.4:
# CHECK-NEXT: successors: %bb.9(0x30000000), %bb.5(0x50000000)
# CHECK: %rax = MOV64rm %r14, 1, _, 0, _
# CHECK-NEXT: TEST64rr %rax, %rax
# CHECK-NEXT: JE_1 %bb.9
# CHECK: bb.5
# CHECK-NEXT: successors: %bb.6(0x71555555), %bb.8(0x0eaaaaab)
# CHECK: CMP64mi8 killed %rax, 1, _, 8, _, 0
# CHECK-NEXT: JNE_1 %bb.8
# CHECK: bb.6:
# CHECK-NEXT: successors: %bb.9(0x04000000), %bb.5(0x7c000000)
# CHECK: %rax = MOV64rm %r14, 1, _, 0, _
# CHECK-NEXT: TEST64rr %rax, %rax
# CHECK-NEXT: JNE_1 %bb.5
name: foo
body: |
bb.0:
successors: %bb.1(0x40000000), %bb.7(0x40000000)
TEST8ri %dl, 1, implicit-def %eflags, implicit killed %edx
JE_1 %bb.7, implicit %eflags
bb.1:
successors: %bb.16(0x80000000)
%ebp = XOR32rr undef %ebp, undef %ebp, implicit-def dead %eflags
JMP_1 %bb.16
bb.7:
successors: %bb.8(0x30000000), %bb.9(0x50000000)
%rax = MOV64rm %r14, 1, _, 0, _ :: (load 8)
TEST64rr %rax, %rax, implicit-def %eflags
JNE_1 %bb.9, implicit killed %eflags
bb.8:
successors: %bb.16(0x80000000)
%ebp = XOR32rr undef %ebp, undef %ebp, implicit-def dead %eflags
JMP_1 %bb.16
bb.9:
successors: %bb.10(0x30000000), %bb.15(0x50000000)
CMP64mi8 killed %rax, 1, _, 8, _, 0, implicit-def %eflags :: (load 8)
JNE_1 %bb.15, implicit %eflags
bb.10:
successors: %bb.11(0x30000000), %bb.12(0x50000000)
%rax = MOV64rm %r14, 1, _, 0, _ :: (load 8)
TEST64rr %rax, %rax, implicit-def %eflags
JNE_1 %bb.12, implicit %eflags
bb.11:
successors: %bb.16(0x80000000)
%ebp = XOR32rr undef %ebp, undef %ebp, implicit-def dead %eflags
JMP_1 %bb.16
bb.12:
successors: %bb.13(0x71555555), %bb.15(0x0eaaaaab)
CMP64mi8 killed %rax, 1, _, 8, _, 0, implicit-def %eflags :: (load 8), (load 8)
JNE_1 %bb.15, implicit %eflags
bb.13:
successors: %bb.14(0x04000000), %bb.12(0x7c000000)
%rax = MOV64rm %r14, 1, _, 0, _ :: (load 8)
TEST64rr %rax, %rax, implicit-def %eflags
JNE_1 %bb.12, implicit %eflags
bb.14:
successors: %bb.16(0x80000000)
%ebp = XOR32rr undef %ebp, undef %ebp, implicit-def dead %eflags
JMP_1 %bb.16
bb.15:
successors: %bb.16(0x80000000)
%ebp = XOR32rr undef %ebp, undef %ebp, implicit-def dead %eflags
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al
bb.16:
RETQ %eax
...