From c46f923481ebe41d2ab5f877689688e78270afdc Mon Sep 17 00:00:00 2001 From: Piotr Sobczak Date: Mon, 18 Dec 2023 16:48:28 +0100 Subject: [PATCH] Revert again "[AMDGPU] Do not assume stack size for PAL code object indirect calls" This reverts commit a22e10e4323cd49d5a130467bcedd527842be8f5. The commit caused page faults in Counter Strike 2. Change-Id: Ieab95f0f9dfaad7d3587f03bfb10eaca03c51155 --- .../AMDGPU/AMDGPUResourceUsageAnalysis.cpp | 4 +--- llvm/test/CodeGen/AMDGPU/resource-usage-pal.ll | 17 ----------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 llvm/test/CodeGen/AMDGPU/resource-usage-pal.ll diff --git a/llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp b/llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp index ac125dad1251ae..3f7dea87e9b16c 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp @@ -104,7 +104,6 @@ bool AMDGPUResourceUsageAnalysis::runOnModule(Module &M) { MachineModuleInfo &MMI = getAnalysis().getMMI(); const TargetMachine &TM = TPC->getTM(); - const MCSubtargetInfo &STI = *TM.getMCSubtargetInfo(); bool HasIndirectCall = false; CallGraph CG = CallGraph(M); @@ -112,8 +111,7 @@ bool AMDGPUResourceUsageAnalysis::runOnModule(Module &M) { // By default, for code object v5 and later, track only the minimum scratch // size - if (AMDGPU::getCodeObjectVersion(M) >= AMDGPU::AMDHSA_COV5 || - STI.getTargetTriple().getOS() == Triple::AMDPAL) { + if (AMDGPU::getCodeObjectVersion(M) >= AMDGPU::AMDHSA_COV5) { if (!AssumedStackSizeForDynamicSizeObjects.getNumOccurrences()) AssumedStackSizeForDynamicSizeObjects = 0; if (!AssumedStackSizeForExternalCall.getNumOccurrences()) diff --git a/llvm/test/CodeGen/AMDGPU/resource-usage-pal.ll b/llvm/test/CodeGen/AMDGPU/resource-usage-pal.ll deleted file mode 100644 index 05f1d5960beb24..00000000000000 --- a/llvm/test/CodeGen/AMDGPU/resource-usage-pal.ll +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s - -; Check that we do not assume any default stack size for PAL code object -; indirect calls. The driver knows the max recursion depth, so it can compute -; a more accurate value. - -; CHECK: ScratchSize: 0 -; CHECK: scratch_memory_size: 0 -define amdgpu_vs void @test() { -.entry: - %0 = call i64 @llvm.amdgcn.s.getpc() - %1 = inttoptr i64 %0 to ptr - call amdgpu_gfx void %1() - ret void -} - -declare i64 @llvm.amdgcn.s.getpc()