[llvm] ffdbbd1 - AMDGPU: Directly pass Function to mayUseAGPRs
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 10:48:58 PDT 2022
Author: Matt Arsenault
Date: 2022-11-02T10:48:51-07:00
New Revision: ffdbbd112c14bdc6d975fc87d9efebea766a6a95
URL: https://github.com/llvm/llvm-project/commit/ffdbbd112c14bdc6d975fc87d9efebea766a6a95
DIFF: https://github.com/llvm/llvm-project/commit/ffdbbd112c14bdc6d975fc87d9efebea766a6a95.diff
LOG: AMDGPU: Directly pass Function to mayUseAGPRs
This was taking the MachineFunction, but only inspecting the
underlying IR.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
index 99967507a200f..80ce18e55c499 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
@@ -106,7 +106,7 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
if (ST.hasGFX90AInsts() &&
ST.getMaxNumVGPRs(F) <= AMDGPU::VGPR_32RegClass.getNumRegs() &&
- !mayUseAGPRs(MF))
+ !mayUseAGPRs(F))
MayNeedAGPRs = false; // We will select all MAI with VGPR operands.
}
@@ -664,8 +664,8 @@ bool SIMachineFunctionInfo::initializeBaseYamlFields(
return false;
}
-bool SIMachineFunctionInfo::mayUseAGPRs(const MachineFunction &MF) const {
- for (const BasicBlock &BB : MF.getFunction()) {
+bool SIMachineFunctionInfo::mayUseAGPRs(const Function &F) const {
+ for (const BasicBlock &BB : F) {
for (const Instruction &I : BB) {
const auto *CB = dyn_cast<CallBase>(&I);
if (!CB)
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
index aff679deb069d..f603244086a9c 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
@@ -991,7 +991,7 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction {
// \returns true if a function has a use of AGPRs via inline asm or
// has a call which may use it.
- bool mayUseAGPRs(const MachineFunction &MF) const;
+ bool mayUseAGPRs(const Function &F) const;
// \returns true if a function needs or may need AGPRs.
bool usesAGPRs(const MachineFunction &MF) const;
More information about the llvm-commits
mailing list