[llvm] [AMDGPU] Fix printing hasInitWholeWave in mir (PR #123232)
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 12:00:20 PST 2025
https://github.com/rampitec created https://github.com/llvm/llvm-project/pull/123232
None
>From 1e11314e38b110af28cb825057572c9669e963f4 Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
Date: Thu, 16 Jan 2025 11:55:37 -0800
Subject: [PATCH] [AMDGPU] Fix printing hasInitWholeWave in mir
---
.../lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 2 +-
.../test/CodeGen/MIR/AMDGPU/init-whole.wave.mir | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 llvm/test/CodeGen/MIR/AMDGPU/init-whole.wave.mir
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index 169f1369fb5433..7de64bddf78846 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -715,7 +715,7 @@ yaml::SIMachineFunctionInfo::SIMachineFunctionInfo(
ArgInfo(convertArgumentInfo(MFI.getArgInfo(), TRI)),
PSInputAddr(MFI.getPSInputAddr()), PSInputEnable(MFI.getPSInputEnable()),
MaxMemoryClusterDWords(MFI.getMaxMemoryClusterDWords()),
- Mode(MFI.getMode()) {
+ Mode(MFI.getMode()), HasInitWholeWave(MFI.hasInitWholeWave()) {
for (Register Reg : MFI.getSGPRSpillPhysVGPRs())
SpillPhysVGPRS.push_back(regToString(Reg, TRI));
diff --git a/llvm/test/CodeGen/MIR/AMDGPU/init-whole.wave.mir b/llvm/test/CodeGen/MIR/AMDGPU/init-whole.wave.mir
new file mode 100644
index 00000000000000..bd2dbba586b7ce
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/AMDGPU/init-whole.wave.mir
@@ -0,0 +1,17 @@
+; RUN: llc -global-isel=0 -march=amdgcn -mcpu=gfx1100 -stop-after=amdgpu-isel < %s | FileCheck --check-prefix=GCN %s
+; RUN: llc -global-isel=1 -march=amdgcn -mcpu=gfx1100 -stop-after=amdgpu-isel < %s | FileCheck --check-prefix=GCN %s
+
+; GCN-LABEL: name: init_wwm
+; GCN: hasInitWholeWave: true
+define void @init_wwm(ptr addrspace(1) inreg %p) {
+entry:
+ %entry_exec = call i1 @llvm.amdgcn.init.whole.wave()
+ br i1 %entry_exec, label %bb.1, label %bb.2
+
+bb.1:
+ store i32 1, ptr addrspace(1) %p
+ br label %bb.2
+
+bb.2:
+ ret void
+}
More information about the llvm-commits
mailing list