LLVM 24.0.0git
AMDGPUMachineInstrs.cpp
Go to the documentation of this file.
1//===-- AMDGPUMachineInstrs.cpp -*- C++ -*---------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// Convenience wrappers and helpers for AMDGPU-specific machine instructions.
10//
11//===----------------------------------------------------------------------===//
12
13#include "AMDGPUMachineInstrs.h"
14#include "GCNSubtarget.h"
18
19using namespace llvm;
20using namespace AMDGPUMI;
21
23 const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
24 unsigned DynamicVGPRBlockSize =
25 MF.getInfo<SIMachineFunctionInfo>()->getDynamicVGPRBlockSize();
26 return std::min(ST.getAddressableNumArchVGPRs(),
27 ST.getAddressableNumVGPRs(DynamicVGPRBlockSize));
28}
29
31 return AMDGPU::getVLdStIdxOpcodeInfoByKey(Bits, /*IsStore=*/false,
32 /*IsGPRIdx=*/false) != nullptr;
33}
AMD GCN specific subclass of TargetSubtarget.
static bool isSupportedBitWidth(unsigned Bits)
static unsigned getNumIndexableVGPRs(const MachineFunction &MF)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
friend class MachineFunction
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
const VLdStIdxOpcodeInfo * getVLdStIdxOpcodeInfoByKey(unsigned BitWidth, bool IsStore, bool IsGPRIdx)
This is an optimization pass for GlobalISel generic memory operations.