Skip to content

Commit 3f8320f

Browse files
committed
change created block names
Signed-off-by: Nathan Gauër <[email protected]>
1 parent e1f9d43 commit 3f8320f

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ class SPIRVStructurizer : public FunctionPass {
443443
if (!Inserted) {
444444
// Src already a source node. Cannot have 2 edges from A to B.
445445
// Creating alias source block.
446-
BasicBlock *NewSrc =
447-
BasicBlock::Create(F.getContext(), "new.src", &F);
446+
BasicBlock *NewSrc = BasicBlock::Create(
447+
F.getContext(), Src->getName() + ".new.src", &F);
448448
replaceBranchTargets(Src, Dst, NewSrc);
449449
IRBuilder<> Builder(NewSrc);
450450
Builder.CreateBr(Dst);
@@ -473,7 +473,8 @@ class SPIRVStructurizer : public FunctionPass {
473473

474474
std::vector<BasicBlock *> Dsts;
475475
std::unordered_map<BasicBlock *, ConstantInt *> DstToIndex;
476-
auto NewExit = BasicBlock::Create(F.getContext(), "new.exit", &F);
476+
auto NewExit = BasicBlock::Create(F.getContext(),
477+
Header->getName() + ".new.exit", &F);
477478
IRBuilder<> ExitBuilder(NewExit);
478479
for (auto &[Src, Dst] : FixedEdges) {
479480
if (DstToIndex.count(Dst) != 0)

llvm/test/CodeGen/SPIRV/structurizer/logical-or.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:
55
target triple = "spirv-unknown-vulkan1.3-compute"
66

77
define internal spir_func void @main() #3 {
8-
; CHECK-DAG: OpName %[[#switch_0:]] "reg2"
8+
; CHECK-DAG: OpName %[[#switch_0:]] "reg1"
99
; CHECK-DAG: OpName %[[#switch_1:]] "reg"
1010

1111
; CHECK-DAG: %[[#int_0:]] = OpConstant %[[#]] 0

llvm/test/CodeGen/SPIRV/structurizer/loop-continue-split.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
1414
target triple = "spirv-unknown-vulkan1.3-compute"
1515

16-
; CHECK-DAG: OpName %[[#switch_0:]] "reg2"
16+
; CHECK-DAG: OpName %[[#switch_0:]] "reg1"
1717
; CHECK-DAG: OpName %[[#variable:]] "var"
1818

1919
; CHECK-DAG: %[[#int_0:]] = OpConstant %[[#]] 0

llvm/test/CodeGen/SPIRV/structurizer/return-early.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s
22
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
33

4-
; CHECK-DAG: OpName %[[#reg_0:]] "reg4"
5-
; CHECK-DAG: OpName %[[#reg_1:]] "reg2"
4+
; CHECK-DAG: OpName %[[#reg_0:]] "reg2"
5+
; CHECK-DAG: OpName %[[#reg_1:]] "reg1"
66

77
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
88
target triple = "spirv-unknown-vulkan1.3-compute"

0 commit comments

Comments
 (0)