diff options
Diffstat (limited to 'lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp index 13b4b50149ce..0d3a1f1a769f 100644 --- a/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp +++ b/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp @@ -1,9 +1,8 @@ //===-- AMDGPUMachineFunctionInfo.cpp ---------------------------------------=// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -30,13 +29,13 @@ AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) : // except reserved size is not correctly aligned. const Function &F = MF.getFunction(); - if (auto *Resolver = MF.getMMI().getResolver()) { - if (AMDGPUPerfHintAnalysis *PHA = static_cast<AMDGPUPerfHintAnalysis*>( - Resolver->getAnalysisIfAvailable(&AMDGPUPerfHintAnalysisID, true))) { - MemoryBound = PHA->isMemoryBound(&F); - WaveLimiter = PHA->needsWaveLimiter(&F); - } - } + Attribute MemBoundAttr = F.getFnAttribute("amdgpu-memory-bound"); + MemoryBound = MemBoundAttr.isStringAttribute() && + MemBoundAttr.getValueAsString() == "true"; + + Attribute WaveLimitAttr = F.getFnAttribute("amdgpu-wave-limiter"); + WaveLimiter = WaveLimitAttr.isStringAttribute() && + WaveLimitAttr.getValueAsString() == "true"; CallingConv::ID CC = F.getCallingConv(); if (CC == CallingConv::AMDGPU_KERNEL || CC == CallingConv::SPIR_KERNEL) |