[llvm] r278841 - [BranchFolding] Change a test case of r278575.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 13:06:26 PDT 2016


Author: haicheng
Date: Tue Aug 16 15:06:25 2016
New Revision: 278841

URL: http://llvm.org/viewvc/llvm-project?rev=278841&view=rev
Log:
[BranchFolding] Change a test case of r278575.

Rename the operands to make the test less brittle.

Modified:
    llvm/trunk/test/CodeGen/X86/tail-merge-after-mbp.ll

Modified: llvm/trunk/test/CodeGen/X86/tail-merge-after-mbp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tail-merge-after-mbp.ll?rev=278841&r1=278840&r2=278841&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tail-merge-after-mbp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tail-merge-after-mbp.ll Tue Aug 16 15:06:25 2016
@@ -9,84 +9,86 @@
 declare i32 @Up(...) 
 declare i32 @f(i32, i32) 
 
-; check loop block BB#10 is not merged with LBB0_12
-; check loop block LBB0_9 is not merged with BB#11, BB#13
+; 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:     LBB0_9:
+; CHECK:     # %block_11
 ; CHECK-NEXT:        movq    (%r14), %rax
 ; CHECK-NEXT:        testq   %rax, %rax
 ; CHECK-NEXT:        je      
-; CHECK-NEXT:# BB#10:
+; CHECK-NEXT:# %block_14
 ; CHECK-NEXT:        cmpq    $0, 8(%rax)
 ; CHECK-NEXT:        jne    
-; CHECK-NEXT:# BB#11:
+; CHECK-NEXT:# %block_18
 ; CHECK-NEXT:        movq    (%r14), %rax
 ; CHECK-NEXT:        testq   %rax, %rax
 ; CHECK-NEXT:        je    
-; CHECK-NEXT:LBB0_12:
+; CHECK-NEXT:# %block_21
+; CHECK-NEXT:# =>This Inner Loop Header
 ; CHECK-NEXT:        cmpq    $0, 8(%rax)
 ; CHECK-NEXT:        jne  
-; CHECK-NEXT:# BB#13:
+; 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 %34, label %3
+  br i1 %c, label %block_34, label %block_3
 
-; <label>:3:                                      ; preds = %2
-  br i1 %c, label %7, label %4
+block_3:                                      ; preds = %2
+  br i1 %c, label %block_7, label %block_4
 
-; <label>:4:                                      ; preds = %3
-  %5 = tail call i32 @f(i32 undef, i32 undef)
-  %6 = icmp eq i32 %5, 0
-  br i1 %6, label %7, label %34
-
-; <label>:7:                                      ; preds = %4, %3
-  %8 = icmp eq %2* null, null
-  br i1 %8, label %34, label %9
-
-; <label>:9:                                      ; preds = %7
-  %10 = icmp eq i8* %p1, null
-  br i1 %10, label %11, label %32
-
-; <label>:11:                                     ; preds = %9
-  %12 = load %2*, %2** %p2, align 8
-  %13 = icmp eq %2* %12, null
-  br i1 %13, label %34, label %14
-
-; <label>:14:                                     ; preds = %11
-  %15 = getelementptr inbounds %2, %2* %12, i64 0, i32 1
-  %16 = load i8*, i8** %15, align 8
-  %17 = icmp eq i8* %16, null
-  br i1 %17, label %18, label %32
-
-; <label>:18:                                     ; preds = %14
-  %19 = load %2*, %2** %p2, align 8
-  %20 = icmp eq %2* %19, null
-  br i1 %20, label %34, label %21
-
-; <label>:21:                                     ; preds = %18
-  %22 = getelementptr inbounds %2, %2* %19, i64 0, i32 1
-  %23 = load i8*, i8** %22, align 8
-  %24 = icmp eq i8* %23, null
-  br i1 %24, label %25, label %32
-
-; <label>:25:                                     ; preds = %28, %21
-  %26 = load %2*, %2** %p2, align 8
-  %27 = icmp eq %2* %26, null
-  br i1 %27, label %34, label %28
-
-; <label>:28:                                     ; preds = %25
-  %29 = getelementptr inbounds %2, %2* %26, i64 0, i32 1
-  %30 = load i8*, i8** %29, align 8
-  %31 = icmp eq i8* %30, null
-  br i1 %31, label %25, label %32
-
-; <label>:32:                                     ; preds = %28, %21, %14, %9
-  %33 = tail call i32 (...) @Up()
-  br label %34
-
-; <label>:34:                                     ; preds = %32, %25, %18, %11, %7, %4, %2
-  %35 = phi i32 [ 0, %2 ], [ %5, %4 ], [ 0, %7 ], [ 0, %11 ], [ 0, %32 ], [ 0, %18 ], [ 0, %25 ]
-  ret i32 %35
+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
 }




More information about the llvm-commits mailing list