LLVM 24.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
19class GCNSubtarget;
21class LLT;
22class MachineFunction;
23class MachineInstr;
26
27namespace AMDGPU {
28
29/// Return whether div.fmas can use ordinary FMA without changing denormals.
30bool isUnscaledIEEEDivFmas(const MachineInstr &MI,
31 const MachineRegisterInfo &MRI);
32
33/// Returns base register and constant offset.
34std::pair<Register, unsigned>
35getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg,
36 GISelValueTracking *ValueTracking = nullptr,
37 bool CheckNUW = false);
38
39// Currently finds S32/S64 lane masks that can be declared as divergent by
40// uniformity analysis (all are phis at the moment).
41// These are defined as i32/i64 in some IR intrinsics (not as i1).
42// Tablegen forces(via telling that lane mask IR intrinsics are uniform) most of
43// S32/S64 lane masks to be uniform, as this results in them ending up with sgpr
44// reg class after instruction-select, don't search for all of them.
46 SmallDenseSet<Register, 8> S32S64LaneMask;
48
49public:
51 bool isS32S64LaneMask(Register Reg) const;
52
53private:
54 void initLaneMaskIntrinsics(MachineFunction &MF);
55};
56
58 const RegisterBankInfo &RBI);
60 const RegisterBankInfo &RBI);
61}
62}
63
64#endif
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the DenseSet and SmallDenseSet classes.
IRTranslator LLVM IR MI
Register Reg
Promote Memory to Register
Definition Mem2Reg.cpp:110
MachineRegisterInfo & MRI
Helper class to build MachineInstr.
Representation of each machine instruction.
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:20
Implements a dense probed hash-table based set with some number of buckets stored inline.
Definition DenseSet.h:295
bool isUnscaledIEEEDivFmas(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Return whether div.fmas can use ordinary FMA without changing denormals.
std::pair< Register, unsigned > getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg, GISelValueTracking *ValueTracking=nullptr, bool CheckNUW=false)
Returns base register and constant offset.
void buildReadAnyLane(MachineIRBuilder &B, Register SgprDst, Register VgprSrc, const RegisterBankInfo &RBI)
void buildReadFirstLane(MachineIRBuilder &B, Register SgprDst, Register VgprSrc, const RegisterBankInfo &RBI)
This is an optimization pass for GlobalISel generic memory operations.