From 25528d6de70e98683722e28655d8568d5f09b5c7 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Mon, 4 Dec 2017 17:18:51 +0000 Subject: [CodeGen] Unify MBB reference format in both MIR and debug output As part of the unification of the debug format and the MIR format, print MBB references as '%bb.5'. The MIR printer prints the IR name of a MBB only for block definitions. * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g' * find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g' * grep -nr 'BB#' and fix Differential Revision: https://reviews.llvm.org/D40422 llvm-svn: 319665 --- llvm/test/CodeGen/X86/cmov-into-branch.ll | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'llvm/test/CodeGen/X86/cmov-into-branch.ll') diff --git a/llvm/test/CodeGen/X86/cmov-into-branch.ll b/llvm/test/CodeGen/X86/cmov-into-branch.ll index 4a29bb4e1db..4c1b2bcb162 100644 --- a/llvm/test/CodeGen/X86/cmov-into-branch.ll +++ b/llvm/test/CodeGen/X86/cmov-into-branch.ll @@ -4,7 +4,7 @@ ; cmp with single-use load, should not form branch. define i32 @test1(double %a, double* nocapture %b, i32 %x, i32 %y) { ; CHECK-LABEL: test1: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: ucomisd (%rdi), %xmm0 ; CHECK-NEXT: cmovbel %edx, %esi ; CHECK-NEXT: movl %esi, %eax @@ -18,7 +18,7 @@ define i32 @test1(double %a, double* nocapture %b, i32 %x, i32 %y) { ; Sanity check: no load. define i32 @test2(double %a, double %b, i32 %x, i32 %y) { ; CHECK-LABEL: test2: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: ucomisd %xmm1, %xmm0 ; CHECK-NEXT: cmovbel %esi, %edi ; CHECK-NEXT: movl %edi, %eax @@ -31,7 +31,7 @@ define i32 @test2(double %a, double %b, i32 %x, i32 %y) { ; Multiple uses of the load. define i32 @test4(i32 %a, i32* nocapture %b, i32 %x, i32 %y) { ; CHECK-LABEL: test4: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: movl (%rsi), %eax ; CHECK-NEXT: cmpl %edi, %eax ; CHECK-NEXT: cmovael %ecx, %edx @@ -47,7 +47,7 @@ define i32 @test4(i32 %a, i32* nocapture %b, i32 %x, i32 %y) { ; Multiple uses of the cmp. define i32 @test5(i32 %a, i32* nocapture %b, i32 %x, i32 %y) { ; CHECK-LABEL: test5: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: cmpl %edi, (%rsi) ; CHECK-NEXT: cmoval %edi, %ecx ; CHECK-NEXT: cmovael %edx, %ecx @@ -64,7 +64,7 @@ define i32 @test5(i32 %a, i32* nocapture %b, i32 %x, i32 %y) { ; Zero-extended select. define void @test6(i32 %a, i32 %x, i32* %y.ptr, i64* %z.ptr) { ; CHECK-LABEL: test6: -; CHECK: # BB#0: # %entry +; CHECK: # %bb.0: # %entry ; CHECK-NEXT: # kill: %esi %esi %rsi ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: cmovnsl (%rdx), %esi @@ -82,7 +82,7 @@ entry: ; If a select is not obviously predictable, don't turn it into a branch. define i32 @weighted_select1(i32 %a, i32 %b) { ; CHECK-LABEL: weighted_select1: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: cmovnel %edi, %esi ; CHECK-NEXT: movl %esi, %eax @@ -95,10 +95,10 @@ define i32 @weighted_select1(i32 %a, i32 %b) { ; If a select is obviously predictable, turn it into a branch. define i32 @weighted_select2(i32 %a, i32 %b) { ; CHECK-LABEL: weighted_select2: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: jne .LBB6_2 -; CHECK-NEXT: # BB#1: # %select.false +; CHECK-NEXT: # %bb.1: # %select.false ; CHECK-NEXT: movl %esi, %edi ; CHECK-NEXT: .LBB6_2: # %select.end ; CHECK-NEXT: movl %edi, %eax @@ -114,10 +114,10 @@ define i32 @weighted_select2(i32 %a, i32 %b) { ; TODO: But likely true vs. likely false should affect basic block placement? define i32 @weighted_select3(i32 %a, i32 %b) { ; CHECK-LABEL: weighted_select3: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: je .LBB7_1 -; CHECK-NEXT: # BB#2: # %select.end +; CHECK-NEXT: # %bb.2: # %select.end ; CHECK-NEXT: movl %edi, %eax ; CHECK-NEXT: retq ; CHECK-NEXT: .LBB7_1: # %select.false @@ -132,7 +132,7 @@ define i32 @weighted_select3(i32 %a, i32 %b) { ; Weightlessness is no reason to die. define i32 @unweighted_select(i32 %a, i32 %b) { ; CHECK-LABEL: unweighted_select: -; CHECK: # BB#0: +; CHECK: # %bb.0: ; CHECK-NEXT: testl %edi, %edi ; CHECK-NEXT: cmovnel %edi, %esi ; CHECK-NEXT: movl %esi, %eax -- cgit v1.2.3