LLVM: lib/Target/AMDGPU/SIFixVGPRCopies.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
19
20using namespace llvm;
21
22#define DEBUG_TYPE "si-fix-vgpr-copies"
23
24namespace {
25
27public:
28 static char ID;
29
32 }
33
34 void getAnalysisUsage(AnalysisUsage &AU) const override {
37 }
38
40
41 StringRef getPassName() const override { return "SI Fix VGPR copies"; }
42};
43
44class SIFixVGPRCopies {
45public:
47};
48
49}
50
52 false)
53
54char SIFixVGPRCopiesLegacy::ID = 0;
55
57
60 SIFixVGPRCopies().run(MF);
62}
63
64bool SIFixVGPRCopiesLegacy::runOnMachineFunction(MachineFunction &MF) {
65 return SIFixVGPRCopies().run(MF);
66}
67
73
76 switch (MI.getOpcode()) {
77 case AMDGPU::COPY:
78 if (TII->isVGPRCopy(MI) && .readsRegister(AMDGPU::EXEC, TRI)) {
79 MI.addOperand(MF,
83 }
84 break;
85 default:
86 break;
87 }
88 }
89 }
90
92}
const TargetInstrInfo & TII
Provides AMDGPU specific target descriptions.
AMD GCN specific subclass of TargetSubtarget.
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Definition SIFixVGPRCopies.cpp:58
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void initializeSIFixVGPRCopiesLegacyPass(PassRegistry &)