Skip to content

Commit 59cbe27

Browse files
committed
[TableGen][GISel] Create untyped registers during instruction selection
Temporary registers are used for linking instructions in the destination DAG of a pattern, and also for discarded defs. Previously, temporary registers were created without a register class/bank, but with a type. This patch removes the type as well. The type shouldn't matter for GlobalISel; registers created during instruction selection should be virtual (as opposed to generic). Virtual registers must have a register class, it will be inferred when constraining operands of selected instructions. GIR_MakeTempReg action was split into two: GIR_MakeGenericTempReg for use in generic instruction combining, and GIR_MakeVirtualTempReg for use in instruction selection. The latter creates an "incomplete" virtual register (one without a type / regclass / regbank); further actions such as GIR_ConstrainSelectedInstOperands should make sure a register gets a register class. `TargetRegisterInfo.cpp` was changed to allow printing such "incomplete" registers. `RegisterBankInfo.cpp` and `SIRegisterInfo.cpp` were changed to support `RegClassOrRegBank` with active `TargetRegisterClass` member that has null value. This change allows importing patterns that have types in the destination DAG that cannot be converted to LLT (such as `MVT::Untyped`) and removes the restriction that interior instructions must have one explicit def. The number of skipped patterns reduces as follows: ``` AArch64 8574 -> 8505 (-69) Mips 1212 -> 1211 (-1) ```
1 parent c56b743 commit 59cbe27

27 files changed

+146
-160
lines changed

llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,14 @@ enum {
550550
/// Combines both a GIR_EraseFromParent 0 + GIR_Done
551551
GIR_EraseRootFromParent_Done,
552552

553-
/// Create a new temporary register that's not constrained.
553+
/// Create a new generic temporary register that's not constrained.
554554
/// - TempRegID(ULEB128) - The temporary register ID to initialize.
555555
/// - Ty(1) - Expected type
556-
GIR_MakeTempReg,
556+
GIR_MakeGenericTempReg,
557+
558+
/// Create a new virtual temporary register that doesn't have register class.
559+
/// - TempRegID(ULEB128) - The temporary register ID to initialize.
560+
GIR_MakeVirtualTempReg,
557561

558562
/// Replaces all references to a register from an instruction
559563
/// with another register from another instruction.

llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,15 +1485,28 @@ bool GIMatchTableExecutor::executeMatchTable(
14851485
propagateFlags();
14861486
return true;
14871487
}
1488-
case GIR_MakeTempReg: {
1488+
case GIR_MakeGenericTempReg: {
14891489
uint64_t TempRegID = readULEB();
14901490
int TypeID = readS8();
14911491

14921492
State.TempRegisters[TempRegID] =
14931493
MRI.createGenericVirtualRegister(getTypeFromIdx(TypeID));
1494-
DEBUG_WITH_TYPE(TgtExecutor::getName(),
1495-
dbgs() << CurrentIdx << ": TempRegs[" << TempRegID
1496-
<< "] = GIR_MakeTempReg(" << TypeID << ")\n");
1494+
DEBUG_WITH_TYPE(TgtExecutor::getName(), {
1495+
dbgs() << CurrentIdx << ": TempRegs[" << TempRegID
1496+
<< "] = GIR_MakeGenericTempReg(" << TypeID << ")\n";
1497+
});
1498+
break;
1499+
}
1500+
case GIR_MakeVirtualTempReg: {
1501+
uint64_t TempRegID = readULEB();
1502+
1503+
Register Reg = MRI.createIncompleteVirtualRegister();
1504+
MRI.noteNewVirtualRegister(Reg);
1505+
State.TempRegisters[TempRegID] = Reg;
1506+
DEBUG_WITH_TYPE(TgtExecutor::getName(), {
1507+
dbgs() << CurrentIdx << ": TempRegs[" << TempRegID
1508+
<< "] = GIR_MakeVirtualTempReg()\n";
1509+
});
14971510
break;
14981511
}
14991512
case GIR_ReplaceReg: {

llvm/lib/CodeGen/RegisterBankInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ const TargetRegisterClass *RegisterBankInfo::constrainGenericRegister(
134134

135135
// If the register already has a class, fallback to MRI::constrainRegClass.
136136
auto &RegClassOrBank = MRI.getRegClassOrRegBank(Reg);
137-
if (isa<const TargetRegisterClass *>(RegClassOrBank))
137+
if (isa_and_nonnull<const TargetRegisterClass *>(RegClassOrBank))
138138
return MRI.constrainRegClass(Reg, &RC);
139139

140-
const RegisterBank *RB = cast<const RegisterBank *>(RegClassOrBank);
140+
const auto *RB = dyn_cast_or_null<const RegisterBank *>(RegClassOrBank);
141141
// Otherwise, all we can do is ensure the bank covers the class, and set it.
142142
if (RB && !RB->covers(RC))
143143
return nullptr;

llvm/lib/CodeGen/TargetRegisterInfo.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,8 @@ Printable printRegClassOrBank(Register Reg, const MachineRegisterInfo &RegInfo,
175175
OS << StringRef(TRI->getRegClassName(RegInfo.getRegClass(Reg))).lower();
176176
else if (RegInfo.getRegBankOrNull(Reg))
177177
OS << StringRef(RegInfo.getRegBankOrNull(Reg)->getName()).lower();
178-
else {
178+
else
179179
OS << "_";
180-
assert((RegInfo.def_empty(Reg) || RegInfo.getType(Reg).isValid()) &&
181-
"Generic registers must have a valid type");
182-
}
183180
});
184181
}
185182

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3708,10 +3708,10 @@ const TargetRegisterClass *
37083708
SIRegisterInfo::getConstrainedRegClassForOperand(const MachineOperand &MO,
37093709
const MachineRegisterInfo &MRI) const {
37103710
const RegClassOrRegBank &RCOrRB = MRI.getRegClassOrRegBank(MO.getReg());
3711-
if (const RegisterBank *RB = dyn_cast<const RegisterBank *>(RCOrRB))
3711+
if (const auto *RB = dyn_cast_or_null<const RegisterBank *>(RCOrRB))
37123712
return getRegClassForTypeOnBank(MRI.getType(MO.getReg()), *RB);
37133713

3714-
if (const auto *RC = dyn_cast<const TargetRegisterClass *>(RCOrRB))
3714+
if (const auto *RC = dyn_cast_or_null<const TargetRegisterClass *>(RCOrRB))
37153715
return getAllocatableClass(RC);
37163716

37173717
return nullptr;

llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fneg.mir

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -679,35 +679,35 @@ body: |
679679
; SI-NEXT: {{ $}}
680680
; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
681681
; SI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
682-
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147483648
683-
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](s32), implicit $exec
682+
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
683+
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](s32), implicit $exec
684684
; SI-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]](s32)
685685
;
686686
; VI-LABEL: name: fneg_fabs_s32_vs
687687
; VI: liveins: $sgpr0
688688
; VI-NEXT: {{ $}}
689689
; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
690690
; VI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
691-
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147483648
692-
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](s32), implicit $exec
691+
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
692+
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](s32), implicit $exec
693693
; VI-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]](s32)
694694
;
695695
; GFX9-LABEL: name: fneg_fabs_s32_vs
696696
; GFX9: liveins: $sgpr0
697697
; GFX9-NEXT: {{ $}}
698698
; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
699699
; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
700-
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147483648
701-
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](s32), implicit $exec
700+
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
701+
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](s32), implicit $exec
702702
; GFX9-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]](s32)
703703
;
704704
; GFX10-LABEL: name: fneg_fabs_s32_vs
705705
; GFX10: liveins: $sgpr0
706706
; GFX10-NEXT: {{ $}}
707707
; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
708708
; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr_32(s32) = G_FABS [[COPY]]
709-
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147483648
710-
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](s32), implicit $exec
709+
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
710+
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s32) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](s32), implicit $exec
711711
; GFX10-NEXT: S_ENDPGM 0, implicit [[V_XOR_B32_e64_]](s32)
712712
%0:sgpr(s32) = COPY $sgpr0
713713
%1:vgpr(s32) = G_FABS %0
@@ -978,35 +978,35 @@ body: |
978978
; SI-NEXT: {{ $}}
979979
; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
980980
; SI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
981-
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147516416
982-
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](<2 x s16>), implicit $exec
981+
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147516416
982+
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](<2 x s16>), implicit $exec
983983
; SI-NEXT: $vgpr0 = COPY [[V_XOR_B32_e64_]](<2 x s16>)
984984
;
985985
; VI-LABEL: name: fneg_fabs_v2s16_vs
986986
; VI: liveins: $sgpr0
987987
; VI-NEXT: {{ $}}
988988
; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
989989
; VI-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
990-
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147516416
991-
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](<2 x s16>), implicit $exec
990+
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147516416
991+
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](<2 x s16>), implicit $exec
992992
; VI-NEXT: $vgpr0 = COPY [[V_XOR_B32_e64_]](<2 x s16>)
993993
;
994994
; GFX9-LABEL: name: fneg_fabs_v2s16_vs
995995
; GFX9: liveins: $sgpr0
996996
; GFX9-NEXT: {{ $}}
997997
; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
998998
; GFX9-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
999-
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147516416
1000-
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](<2 x s16>), implicit $exec
999+
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147516416
1000+
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](<2 x s16>), implicit $exec
10011001
; GFX9-NEXT: $vgpr0 = COPY [[V_XOR_B32_e64_]](<2 x s16>)
10021002
;
10031003
; GFX10-LABEL: name: fneg_fabs_v2s16_vs
10041004
; GFX10: liveins: $sgpr0
10051005
; GFX10-NEXT: {{ $}}
10061006
; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
10071007
; GFX10-NEXT: [[FABS:%[0-9]+]]:vgpr_32(<2 x s16>) = G_FABS [[COPY]]
1008-
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s16) = S_MOV_B32 2147516416
1009-
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]](s16), [[FABS]](<2 x s16>), implicit $exec
1008+
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147516416
1009+
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(<2 x s16>) = V_XOR_B32_e64 [[S_MOV_B32_]], [[FABS]](<2 x s16>), implicit $exec
10101010
; GFX10-NEXT: $vgpr0 = COPY [[V_XOR_B32_e64_]](<2 x s16>)
10111011
%0:sgpr(<2 x s16>) = COPY $sgpr0
10121012
%1:vgpr(<2 x s16>) = G_FABS %0
@@ -1148,47 +1148,47 @@ body: |
11481148
; SI-NEXT: {{ $}}
11491149
; SI-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
11501150
; SI-NEXT: [[FABS:%[0-9]+]]:vreg_64(s64) = G_FABS [[COPY]]
1151-
; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub1(s64)
1152-
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s32) = S_MOV_B32 2147483648
1153-
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s16) = V_XOR_B32_e64 [[S_MOV_B32_]](s32), [[COPY1]](s32), implicit $exec
1154-
; SI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub0(s64)
1155-
; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]](s32), %subreg.sub0, [[V_XOR_B32_e64_]](s16), %subreg.sub1
1151+
; SI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub1(s64)
1152+
; SI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
1153+
; SI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
1154+
; SI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub0(s64)
1155+
; SI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_XOR_B32_e64_]], %subreg.sub1
11561156
; SI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]](s64)
11571157
;
11581158
; VI-LABEL: name: fneg_fabs_s64_vs
11591159
; VI: liveins: $sgpr0_sgpr1
11601160
; VI-NEXT: {{ $}}
11611161
; VI-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
11621162
; VI-NEXT: [[FABS:%[0-9]+]]:vreg_64(s64) = G_FABS [[COPY]]
1163-
; VI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub1(s64)
1164-
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s32) = S_MOV_B32 2147483648
1165-
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s16) = V_XOR_B32_e64 [[S_MOV_B32_]](s32), [[COPY1]](s32), implicit $exec
1166-
; VI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub0(s64)
1167-
; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]](s32), %subreg.sub0, [[V_XOR_B32_e64_]](s16), %subreg.sub1
1163+
; VI-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub1(s64)
1164+
; VI-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
1165+
; VI-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
1166+
; VI-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub0(s64)
1167+
; VI-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_XOR_B32_e64_]], %subreg.sub1
11681168
; VI-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]](s64)
11691169
;
11701170
; GFX9-LABEL: name: fneg_fabs_s64_vs
11711171
; GFX9: liveins: $sgpr0_sgpr1
11721172
; GFX9-NEXT: {{ $}}
11731173
; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
11741174
; GFX9-NEXT: [[FABS:%[0-9]+]]:vreg_64(s64) = G_FABS [[COPY]]
1175-
; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub1(s64)
1176-
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s32) = S_MOV_B32 2147483648
1177-
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s16) = V_XOR_B32_e64 [[S_MOV_B32_]](s32), [[COPY1]](s32), implicit $exec
1178-
; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub0(s64)
1179-
; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]](s32), %subreg.sub0, [[V_XOR_B32_e64_]](s16), %subreg.sub1
1175+
; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub1(s64)
1176+
; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
1177+
; GFX9-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
1178+
; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub0(s64)
1179+
; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_XOR_B32_e64_]], %subreg.sub1
11801180
; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]](s64)
11811181
;
11821182
; GFX10-LABEL: name: fneg_fabs_s64_vs
11831183
; GFX10: liveins: $sgpr0_sgpr1
11841184
; GFX10-NEXT: {{ $}}
11851185
; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
11861186
; GFX10-NEXT: [[FABS:%[0-9]+]]:vreg_64(s64) = G_FABS [[COPY]]
1187-
; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub1(s64)
1188-
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32(s32) = S_MOV_B32 2147483648
1189-
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32(s16) = V_XOR_B32_e64 [[S_MOV_B32_]](s32), [[COPY1]](s32), implicit $exec
1190-
; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY [[FABS]].sub0(s64)
1191-
; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]](s32), %subreg.sub0, [[V_XOR_B32_e64_]](s16), %subreg.sub1
1187+
; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub1(s64)
1188+
; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483648
1189+
; GFX10-NEXT: [[V_XOR_B32_e64_:%[0-9]+]]:vgpr_32 = V_XOR_B32_e64 [[S_MOV_B32_]], [[COPY1]], implicit $exec
1190+
; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[FABS]].sub0(s64)
1191+
; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64(s64) = REG_SEQUENCE [[COPY2]], %subreg.sub0, [[V_XOR_B32_e64_]], %subreg.sub1
11921192
; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]](s64)
11931193
%0:sgpr(s64) = COPY $sgpr0_sgpr1
11941194
%1:vgpr(s64) = G_FABS %0

llvm/test/TableGen/GlobalISelCombinerEmitter/builtins/match-table-replacerreg.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
4848
// CHECK-NEXT: // MIs[1] y
4949
// CHECK-NEXT: // No operand predicates
5050
// CHECK-NEXT: GIM_CheckIsSafeToFold, /*NumInsns*/1,
51-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
51+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
5252
// CHECK-NEXT: // Combiner Rule #1: ReplaceTemp
5353
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_UNMERGE_VALUES),
5454
// CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/0, // a

llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-imms.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
7373
// CHECK-NEXT: // No operand predicates
7474
// CHECK-NEXT: // MIs[0] Operand 1
7575
// CHECK-NEXT: GIM_CheckConstantInt8, /*MI*/0, /*Op*/1, 0,
76-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
76+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
7777
// CHECK-NEXT: GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
7878
// CHECK-NEXT: // Combiner Rule #1: InstTest1
7979
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::COPY),

llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-intrinsics.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
4141
// CHECK-NEXT: // No operand predicates
4242
// CHECK-NEXT: // MIs[0] Operand 2
4343
// CHECK-NEXT: GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
44-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
44+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
4545
// CHECK-NEXT: // Combiner Rule #0: IntrinTest0
4646
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_INTRINSIC),
4747
// CHECK-NEXT: GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
@@ -62,7 +62,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
6262
// CHECK-NEXT: // No operand predicates
6363
// CHECK-NEXT: // MIs[0] b
6464
// CHECK-NEXT: // No operand predicates
65-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
65+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
6666
// CHECK-NEXT: // Combiner Rule #1: SpecialIntrins
6767
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_INTRINSIC_CONVERGENT),
6868
// CHECK-NEXT: GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),

llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-operand-types.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
3333
// CHECK-NEXT: // MIs[1] b
3434
// CHECK-NEXT: GIM_CheckIsSameOperandIgnoreCopies, /*MI*/1, /*OpIdx*/1, /*OtherMI*/0, /*OtherOpIdx*/1,
3535
// CHECK-NEXT: GIM_CheckIsSafeToFold, /*NumInsns*/1,
36-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
36+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
3737
// CHECK-NEXT: // Combiner Rule #0: InstTest0
3838
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_ADD),
3939
// CHECK-NEXT: GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),

llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-patfrag-root.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
3939
// CHECK-NEXT: // No operand predicates
4040
// CHECK-NEXT: // MIs[0] __Test0_match_0.z
4141
// CHECK-NEXT: // No operand predicates
42-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
42+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
4343
// CHECK-NEXT: GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
4444
// CHECK-NEXT: // Combiner Rule #0: Test0 @ [__Test0_match_0[1]]
4545
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::COPY),
@@ -59,7 +59,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
5959
// CHECK-NEXT: // MIs[1] __Test0_match_0.x
6060
// CHECK-NEXT: // No operand predicates
6161
// CHECK-NEXT: GIM_CheckIsSafeToFold, /*NumInsns*/1,
62-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
62+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
6363
// CHECK-NEXT: GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
6464
// CHECK-NEXT: // Combiner Rule #0: Test0 @ [__Test0_match_0[0]]
6565
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::COPY),
@@ -75,7 +75,7 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
7575
// CHECK-NEXT: // No operand predicates
7676
// CHECK-NEXT: // MIs[0] __Test0_match_0.z
7777
// CHECK-NEXT: // No operand predicates
78-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
78+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
7979
// CHECK-NEXT: GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
8080
// CHECK-NEXT: // Combiner Rule #0: Test0 @ [__Test0_match_0[2]]
8181
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::COPY),

llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-typeof.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def Test0 : GICombineRule<
2525
// CHECK-NEXT: GIM_RecordRegType, /*MI*/0, /*Op*/1, /*TempTypeIdx*/uint8_t(-2),
2626
// CHECK-NEXT: // MIs[0] Operand 2
2727
// CHECK-NEXT: GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, uint8_t(-1),
28-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/1, /*TypeID*/uint8_t(-2),
28+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/1, /*TypeID*/uint8_t(-2),
2929
// CHECK-NEXT: GIR_BuildConstant, /*TempRegID*/1, /*Val*/GIMT_Encode8(0),
30-
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/uint8_t(-1),
30+
// CHECK-NEXT: GIR_MakeGenericTempReg, /*TempRegID*/0, /*TypeID*/uint8_t(-1),
3131
// CHECK-NEXT: // Combiner Rule #0: Test0
3232
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_CONSTANT),
3333
// CHECK-NEXT: GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),

0 commit comments

Comments
 (0)