diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp index b7c8c121353..13b4b50149c 100644 --- a/gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp +++ b/gnu/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp @@ -9,20 +9,38 @@ #include "AMDGPUMachineFunction.h" #include "AMDGPUSubtarget.h" +#include "AMDGPUPerfHintAnalysis.h" +#include "llvm/CodeGen/MachineModuleInfo.h" using namespace llvm; AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) : MachineFunctionInfo(), LocalMemoryObjects(), - KernArgSize(0), + ExplicitKernArgSize(0), MaxKernArgAlign(0), LDSSize(0), - ABIArgOffset(0), IsEntryFunction(AMDGPU::isEntryFunctionCC(MF.getFunction().getCallingConv())), - NoSignedZerosFPMath(MF.getTarget().Options.NoSignedZerosFPMath) { + NoSignedZerosFPMath(MF.getTarget().Options.NoSignedZerosFPMath), + MemoryBound(false), + WaveLimiter(false) { + const AMDGPUSubtarget &ST = AMDGPUSubtarget::get(MF); + // FIXME: Should initialize KernArgSize based on ExplicitKernelArgOffset, // 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); + } + } + + CallingConv::ID CC = F.getCallingConv(); + if (CC == CallingConv::AMDGPU_KERNEL || CC == CallingConv::SPIR_KERNEL) + ExplicitKernArgSize = ST.getExplicitKernArgSize(F, MaxKernArgAlign); } unsigned AMDGPUMachineFunction::allocateLDSGlobal(const DataLayout &DL, |
