[PATCH] D106452: [AMDGPU] Fix running ResourceUsageAnalysis
Sebastian Neubauer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 23 00:34:33 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2f15319968ec: [AMDGPU] Fix running ResourceUsageAnalysis (authored by sebastian-ne).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106452/new/
https://reviews.llvm.org/D106452
Files:
llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.h
Index: llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.h
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.h
+++ llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.h
@@ -51,13 +51,21 @@
bool runOnSCC(CallGraphSCC &SCC) override;
+ bool doInitialization(CallGraph &CG) override {
+ CallGraphResourceInfo.clear();
+ return CallGraphSCCPass::doInitialization(CG);
+ }
+
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineModuleInfoWrapperPass>();
AU.setPreservesAll();
}
const SIFunctionResourceInfo &getResourceInfo(const Function *F) const {
- return CallGraphResourceInfo.find(F)->getSecond();
+ auto Info = CallGraphResourceInfo.find(F);
+ assert(Info != CallGraphResourceInfo.end() &&
+ "Failed to find resource info for function");
+ return Info->getSecond();
}
private:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106452.361111.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210723/118107ba/attachment.bin>
More information about the llvm-commits
mailing list