[PATCH] D106452: [AMDGPU] Fix running ResourceUsageAnalysis

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 08:47:33 PDT 2021


sebastian-ne created this revision.
sebastian-ne added reviewers: arsenm, madhur13490, dstuttard.
Herald added subscribers: foad, kerbowa, hiraditya, t-tye, tpr, yaxunl, nhaehnle, jvesely, kzhuravl.
sebastian-ne requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Clear the map when running the analysis multiple times.
The assertion below that should ensure that every function is only
analyzed once triggered sometimes (once every ~70 compiles of some
graphics pipelines).

If someone knows how to add a testcase, that would be nice, because
I don't know how to test for this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106452

Files:
  llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp


Index: llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
@@ -123,6 +123,8 @@
 AMDGPUResourceUsageAnalysis::SIFunctionResourceInfo
 AMDGPUResourceUsageAnalysis::analyzeResourceUsage(
     const MachineFunction &MF, const TargetMachine &TM) const {
+  CallGraphResourceInfo.clear();
+
   SIFunctionResourceInfo Info;
 
   const SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106452.360480.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/8a0e6fa0/attachment.bin>


More information about the llvm-commits mailing list