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/AVR/atomics/fence.ll | 2 +- .../AVR/select-must-add-unconditional-jump.ll | 24 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'llvm/test/CodeGen/AVR') diff --git a/llvm/test/CodeGen/AVR/atomics/fence.ll b/llvm/test/CodeGen/AVR/atomics/fence.ll index 6ea49bc7e3f..b4cd215f3a2 100644 --- a/llvm/test/CodeGen/AVR/atomics/fence.ll +++ b/llvm/test/CodeGen/AVR/atomics/fence.ll @@ -4,7 +4,7 @@ ; AVR is always singlethreaded so fences do nothing. ; CHECK_LABEL: atomic_fence8 -; CHECK: ; BB#0: +; CHECK: ; %bb.0: ; CHECK-NEXT: ret define void @atomic_fence8() { fence acquire diff --git a/llvm/test/CodeGen/AVR/select-must-add-unconditional-jump.ll b/llvm/test/CodeGen/AVR/select-must-add-unconditional-jump.ll index 64faff70a33..5c247f6e8e6 100644 --- a/llvm/test/CodeGen/AVR/select-must-add-unconditional-jump.ll +++ b/llvm/test/CodeGen/AVR/select-must-add-unconditional-jump.ll @@ -9,18 +9,18 @@ ; ; This issue manifests in a CFG that looks something like this: ; -; BB#2: derived from LLVM BB %finish -; Predecessors according to CFG: BB#0 BB#1 -; %0 = PHI %3, , %5, +; %bb.2: derived from LLVM BB %finish +; Predecessors according to CFG: %bb.0 %bb.1 +; %0 = PHI %3, <%bb.0>, %5, <%bb.1> ; %7 = LDIRdK 2 ; %8 = LDIRdK 1 ; CPRdRr %2, %0, %SREG -; BREQk , %SREG -; Successors according to CFG: BB#5(?%) BB#6(?%) +; BREQk <%bb.6>, %SREG +; Successors according to CFG: %bb.5(?%) %bb.6(?%) ; -; The code assumes it the fallthrough block after this is BB#5, but -; it's actually BB#3! To be proper, there should be an unconditional -; jump tying this block to BB#5. +; The code assumes it the fallthrough block after this is %bb.5, but +; it's actually %bb.3! To be proper, there should be an unconditional +; jump tying this block to %bb.5. define i8 @select_must_add_unconditional_jump(i8 %arg0, i8 %arg1) unnamed_addr { entry-block: @@ -49,10 +49,10 @@ dead: ; basic block containing `select` needs to contain explicit jumps to ; both successors. -; CHECK: BB#2: derived from LLVM BB %finish -; CHECK: BREQk <[[BRANCHED:BB#[0-9]+]]> -; CHECK: RJMPk <[[DIRECT:BB#[0-9]+]]> +; CHECK: %bb.2: derived from LLVM BB %finish +; CHECK: BREQk <[[BRANCHED:%bb.[0-9]+]]> +; CHECK: RJMPk <[[DIRECT:%bb.[0-9]+]]> ; CHECK: Successors according to CFG ; CHECK-SAME-DAG: {{.*}}[[BRANCHED]] ; CHECK-SAME-DAG: {{.*}}[[DIRECT]] -; CHECK: BB#3: derived from LLVM BB +; CHECK: %bb.3: derived from LLVM BB -- cgit v1.2.3