Skip to content

Commit 9d77e6b

Browse files
committed
CodeGen: Make all targets override pseudos with pointers
This eliminates the need to have PointerLikeRegClass handling in codegen.
1 parent 8f62ad4 commit 9d77e6b

File tree

26 files changed

+94
-10
lines changed

26 files changed

+94
-10
lines changed

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ include "AArch64SchedPredExynos.td"
4040
include "AArch64SchedPredNeoverse.td"
4141
include "AArch64Combine.td"
4242

43+
defm : RemapAllTargetPseudoPointerOperands<GPR64sp>;
44+
4345
def AArch64InstrInfo : InstrInfo;
4446

4547
//===----------------------------------------------------------------------===//

llvm/lib/Target/AMDGPU/R600.td

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88

99
include "llvm/Target/Target.td"
1010

11-
def R600InstrInfo : InstrInfo {
12-
let guessInstructionProperties = 1;
13-
}
14-
15-
def R600 : Target {
16-
let InstructionSet = R600InstrInfo;
17-
let AllowRegisterRenaming = 1;
18-
}
19-
2011
let Namespace = "R600" in {
2112

2213
foreach Index = 0-15 in {
@@ -27,6 +18,18 @@ include "R600RegisterInfo.td"
2718

2819
}
2920

21+
defm : RemapAllTargetPseudoPointerOperands<R600_Addr>;
22+
23+
def R600InstrInfo : InstrInfo {
24+
let guessInstructionProperties = 1;
25+
}
26+
27+
def R600 : Target {
28+
let InstructionSet = R600InstrInfo;
29+
let AllowRegisterRenaming = 1;
30+
}
31+
32+
3033
def NullALU : InstrItinClass;
3134
def ALU_NULL : FuncUnit;
3235

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4745,3 +4745,14 @@ def V_ILLEGAL : Enc32, InstSI<(outs), (ins), "v_illegal"> {
47454745
let hasSideEffects = 1;
47464746
let SubtargetPredicate = isGFX10Plus;
47474747
}
4748+
4749+
defvar VGPR32_Ptr_Opcodes = [LOAD_STACK_GUARD];
4750+
defvar VGPR64_Ptr_Opcodes = !listremove(PseudosWithPtrOps, VGPR32_Ptr_Opcodes);
4751+
4752+
foreach inst = VGPR32_Ptr_Opcodes in {
4753+
def : RemapPointerOperands<inst, VGPR_32>;
4754+
}
4755+
4756+
foreach inst = VGPR64_Ptr_Opcodes in {
4757+
def : RemapPointerOperands<inst, VReg_64_AlignTarget>;
4758+
}

llvm/lib/Target/ARM/ARM.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ include "ARMSchedule.td"
3838
//===----------------------------------------------------------------------===//
3939

4040
include "ARMInstrInfo.td"
41+
42+
def Thumb1OnlyMode : HwMode<[IsThumb1Only]>;
43+
def arm_ptr_rc : RegClassByHwMode<
44+
[DefaultMode, Thumb1OnlyMode],
45+
[GPR, tGPR]>;
46+
47+
defm : RemapAllTargetPseudoPointerOperands<arm_ptr_rc>;
48+
4149
def ARMInstrInfo : InstrInfo;
4250

4351
//===----------------------------------------------------------------------===//

llvm/lib/Target/AVR/AVR.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ include "AVRRegisterInfo.td"
3232

3333
include "AVRInstrInfo.td"
3434

35+
defm : RemapAllTargetPseudoPointerOperands<PTRDISPREGS>;
36+
3537
def AVRInstrInfo : InstrInfo;
3638

3739
//===---------------------------------------------------------------------===//

llvm/lib/Target/BPF/BPF.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ include "BPFCallingConv.td"
1313
include "BPFInstrInfo.td"
1414
include "GISel/BPFRegisterBanks.td"
1515

16+
17+
defm : RemapAllTargetPseudoPointerOperands<GPR>;
18+
1619
def BPFInstrInfo : InstrInfo;
1720

1821
class Proc<string Name, list<SubtargetFeature> Features>

llvm/lib/Target/CSKY/CSKY.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,8 @@ def : CK860V<"ck860fv", NoSchedModel,
671671
// Define the CSKY target.
672672
//===----------------------------------------------------------------------===//
673673

674+
defm : RemapAllTargetPseudoPointerOperands<GPR>;
675+
674676
def CSKYInstrInfo : InstrInfo;
675677

676678

llvm/lib/Target/DirectX/DirectX.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include "DXILStubs.td"
2222
// DirectX Subtarget features.
2323
//===----------------------------------------------------------------------===//
2424

25+
defm : RemapAllTargetPseudoPointerOperands<DXILClass>;
26+
2527
def DirectXInstrInfo : InstrInfo;
2628

2729
//===----------------------------------------------------------------------===//

llvm/lib/Target/Hexagon/Hexagon.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ include "HexagonPatternsV65.td"
408408
include "HexagonDepMappings.td"
409409
include "HexagonIntrinsics.td"
410410

411+
defm : RemapAllTargetPseudoPointerOperands<IntRegs>;
412+
411413
def HexagonInstrInfo : InstrInfo;
412414

413415
//===----------------------------------------------------------------------===//

llvm/lib/Target/Lanai/Lanai.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ include "LanaiRegisterInfo.td"
2121
include "LanaiCallingConv.td"
2222
include "LanaiInstrInfo.td"
2323

24+
defm : RemapAllTargetPseudoPointerOperands<GPR>;
25+
2426
def LanaiInstrInfo : InstrInfo;
2527

2628
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)