LLVM 20.0.0git
AMDGPUGlobalISelUtils.h
Go to the documentation of this file.
1//===- AMDGPUGlobalISelUtils -------------------------------------*- 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#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUGLOBALISELUTILS_H
10#define LLVM_LIB_TARGET_AMDGPU_AMDGPUGLOBALISELUTILS_H
11
12#include "llvm/ADT/DenseSet.h"
14#include <utility>
15
16namespace llvm {
17
18class MachineRegisterInfo;
19class GCNSubtarget;
20class GISelKnownBits;
21class LLT;
22class MachineFunction;
23class MachineIRBuilder;
24class RegisterBankInfo;
25
26namespace AMDGPU {
27
28/// Returns base register and constant offset.
29std::pair<Register, unsigned>
30getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg,
31 GISelKnownBits *KnownBits = nullptr,
32 bool CheckNUW = false);
33
34// Currently finds S32/S64 lane masks that can be declared as divergent by
35// uniformity analysis (all are phis at the moment).
36// These are defined as i32/i64 in some IR intrinsics (not as i1).
37// Tablegen forces(via telling that lane mask IR intrinsics are uniform) most of
38// S32/S64 lane masks to be uniform, as this results in them ending up with sgpr
39// reg class after instruction-select, don't search for all of them.
41 SmallDenseSet<Register, 8> S32S64LaneMask;
43
44public:
46 bool isS32S64LaneMask(Register Reg) const;
47
48private:
49 void initLaneMaskIntrinsics(MachineFunction &MF);
50 // This will not be needed when we turn off LCSSA for global-isel.
51 void findLCSSAPhi(Register Reg);
52};
53
55 const RegisterBankInfo &RBI);
56}
57}
58
59#endif
unsigned const MachineRegisterInfo * MRI
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the DenseSet and SmallDenseSet classes.
unsigned Reg
Helper class to build MachineInstr.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Holds all the information related to register banks.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
Implements a dense probed hash-table based set with some number of buckets stored inline.
Definition: DenseSet.h:298
void buildReadAnyLane(MachineIRBuilder &B, Register SgprDst, Register VgprSrc, const RegisterBankInfo &RBI)
std::pair< Register, unsigned > getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg, GISelKnownBits *KnownBits=nullptr, bool CheckNUW=false)
Returns base register and constant offset.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18