Skip to content

Commit 95f0606

Browse files
committed
AMDGPU/SI: Remove EXECReg
For the same reasons as the other physical registers. llvm-svn: 244062
1 parent 4c0487b commit 95f0606

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,6 @@ bool SIInstrInfo::isMov(unsigned Opcode) const {
898898
}
899899
}
900900

901-
bool
902-
SIInstrInfo::isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const {
903-
return RC != &AMDGPU::EXECRegRegClass;
904-
}
905-
906901
static void removeModOperands(MachineInstr &MI) {
907902
unsigned Opc = MI.getOpcode();
908903
int Src0ModIdx = AMDGPU::getNamedOperandIdx(Opc,

llvm/lib/Target/AMDGPU/SIInstrInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ class SIInstrInfo : public AMDGPUInstrInfo {
132132
unsigned DstReg, unsigned SrcReg) const override;
133133
bool isMov(unsigned Opcode) const override;
134134

135-
bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const override;
136-
137135
bool FoldImmediate(MachineInstr *UseMI, MachineInstr *DefMI,
138136
unsigned Reg, MachineRegisterInfo *MRI) const final;
139137

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,16 @@ def S_CBRANCH_VCCNZ : SOPP <
458458
"s_cbranch_vccnz $simm16"
459459
>;
460460

461-
let DisableEncoding = "$exec" in {
461+
let Uses = [EXEC] in {
462462
def S_CBRANCH_EXECZ : SOPP <
463-
0x00000008, (ins sopp_brtarget:$simm16, EXECReg:$exec),
463+
0x00000008, (ins sopp_brtarget:$simm16),
464464
"s_cbranch_execz $simm16"
465465
>;
466466
def S_CBRANCH_EXECNZ : SOPP <
467-
0x00000009, (ins sopp_brtarget:$simm16, EXECReg:$exec),
467+
0x00000009, (ins sopp_brtarget:$simm16),
468468
"s_cbranch_execnz $simm16"
469469
>;
470-
} // End DisableEncoding = "$exec"
470+
} // End Uses = [EXEC]
471471

472472

473473
} // End isBranch = 1

llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ void SILowerControlFlowPass::Skip(MachineInstr &From, MachineOperand &To) {
140140

141141
DebugLoc DL = From.getDebugLoc();
142142
BuildMI(*From.getParent(), &From, DL, TII->get(AMDGPU::S_CBRANCH_EXECZ))
143-
.addOperand(To)
144-
.addReg(AMDGPU::EXEC);
143+
.addOperand(To);
145144
}
146145

147146
void SILowerControlFlowPass::SkipIfDead(MachineInstr &MI) {
@@ -159,8 +158,7 @@ void SILowerControlFlowPass::SkipIfDead(MachineInstr &MI) {
159158

160159
// If the exec mask is non-zero, skip the next two instructions
161160
BuildMI(MBB, Insert, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
162-
.addImm(3)
163-
.addReg(AMDGPU::EXEC);
161+
.addImm(3);
164162

165163
// Exec mask is zero: Export to NULL target...
166164
BuildMI(MBB, Insert, DL, TII->get(AMDGPU::EXP))
@@ -269,8 +267,7 @@ void SILowerControlFlowPass::Loop(MachineInstr &MI) {
269267
.addReg(Src);
270268

271269
BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
272-
.addOperand(MI.getOperand(1))
273-
.addReg(AMDGPU::EXEC);
270+
.addOperand(MI.getOperand(1));
274271

275272
MI.eraseFromParent();
276273
}
@@ -385,8 +382,7 @@ void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel, int
385382

386383
// Loop back to V_READFIRSTLANE_B32 if there are still variants to cover
387384
BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
388-
.addImm(-7)
389-
.addReg(AMDGPU::EXEC);
385+
.addImm(-7);
390386

391387
// Restore EXEC
392388
BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B64), AMDGPU::EXEC)

llvm/lib/Target/AMDGPU/SIRegisterInfo.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ class RegImmMatcher<string name> : AsmOperandClass {
183183
}
184184

185185
def VCCReg : RegisterClass<"AMDGPU", [i64, i1], 64, (add VCC)>;
186-
def EXECReg : RegisterClass<"AMDGPU", [i64, i1], 64, (add EXEC)>;
187186

188187
// Register class for all scalar registers (SGPRs + Special Registers)
189188
def SReg_32 : RegisterClass<"AMDGPU", [i32, f32], 32,
@@ -193,7 +192,7 @@ def SReg_32 : RegisterClass<"AMDGPU", [i32, f32], 32,
193192
def SGPR_64 : RegisterClass<"AMDGPU", [v2i32, i64, f64], 64, (add SGPR_64Regs)>;
194193

195194
def SReg_64 : RegisterClass<"AMDGPU", [v2i32, i64, f64, i1], 64,
196-
(add SGPR_64, VCCReg, EXECReg, FLAT_SCR)
195+
(add SGPR_64, VCCReg, EXEC, FLAT_SCR)
197196
>;
198197

199198
def SReg_128 : RegisterClass<"AMDGPU", [v4i32, v16i8], 128, (add SGPR_128)>;

0 commit comments

Comments
 (0)