diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-04 17:18:51 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-04 17:18:51 +0000 |
commit | 25528d6de70e98683722e28655d8568d5f09b5c7 (patch) | |
tree | 061a9b3bfa623e3f38efd5fc02c6ec234acfcfde /llvm/test/CodeGen/X86/cmov-into-branch.ll | |
parent | 2b4385846c86078e0012e7bfb2e8dc6476ae8dd0 (diff) | |
download | bcm5719-llvm-25528d6de70e98683722e28655d8568d5f09b5c7.tar.gz bcm5719-llvm-25528d6de70e98683722e28655d8568d5f09b5c7.zip |
[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
Diffstat (limited to 'llvm/test/CodeGen/X86/cmov-into-branch.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/cmov-into-branch.ll | 22 |
1 files changed, 11 insertions, 11 deletions
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<def> %esi<kill> %rsi<def> ; 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 |