Skip to content

Commit 586a713

Browse files
authored
[RISCV][LoongArch] Prefix tablegen class names for intrinsics with 'RISCV'. NFC (#154821)
All targets are included by Intrinsics.td so we should name things carefully to avoid interfering with other targets. Copy one class that LoongArch was also using.
1 parent 49d4712 commit 586a713

File tree

3 files changed

+41
-37
lines changed

3 files changed

+41
-37
lines changed

llvm/include/llvm/IR/IntrinsicsLoongArch.td

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ let TargetPrefix = "loongarch" in {
1919
class MaskedAtomicRMW<LLVMType itype>
2020
: Intrinsic<[itype], [llvm_anyptr_ty, itype, itype, itype],
2121
[IntrArgMemOnly, NoCapture<ArgIndex<0>>, ImmArg<ArgIndex<3>>]>;
22+
// T @llvm.<name>.T.<p>(any*, T, T, T, T imm);
23+
class LoongArchMaskedAtomicRMWFiveArg<LLVMType itype>
24+
: Intrinsic<[itype], [llvm_anyptr_ty, itype, itype, itype, itype],
25+
[IntrArgMemOnly, NoCapture<ArgIndex<0>>, ImmArg<ArgIndex<4>>]>;
2226

2327
// We define 32-bit and 64-bit variants of the above, where T stands for i32
2428
// or i64 respectively:
@@ -31,9 +35,9 @@ multiclass MaskedAtomicRMWIntrinsics {
3135

3236
multiclass MaskedAtomicRMWFiveOpIntrinsics {
3337
// i32 @llvm.<name>.i32.<p>(any*, i32, i32, i32, i32 imm);
34-
def _i32 : MaskedAtomicRMWFiveArg<llvm_i32_ty>;
38+
def _i32 : LoongArchMaskedAtomicRMWFiveArg<llvm_i32_ty>;
3539
// i64 @llvm.<name>.i64.<p>(any*, i64, i64, i64, i64 imm);
36-
def _i64 : MaskedAtomicRMWFiveArg<llvm_i64_ty>;
40+
def _i64 : LoongArchMaskedAtomicRMWFiveArg<llvm_i64_ty>;
3741
}
3842

3943
defm int_loongarch_masked_atomicrmw_xchg : MaskedAtomicRMWIntrinsics;

llvm/include/llvm/IR/IntrinsicsRISCV.td

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@
2626
let TargetPrefix = "riscv" in {
2727

2828
// T @llvm.<name>.T.<p>(any*, T, T, T imm);
29-
class MaskedAtomicRMWFourArg<LLVMType itype>
29+
class RISCVMaskedAtomicRMWFourArg<LLVMType itype>
3030
: Intrinsic<[itype], [llvm_anyptr_ty, itype, itype, itype],
3131
[IntrArgMemOnly, NoCapture<ArgIndex<0>>, ImmArg<ArgIndex<3>>]>;
3232
// T @llvm.<name>.T.<p>(any*, T, T, T, T imm);
33-
class MaskedAtomicRMWFiveArg<LLVMType itype>
33+
class RISCVMaskedAtomicRMWFiveArg<LLVMType itype>
3434
: Intrinsic<[itype], [llvm_anyptr_ty, itype, itype, itype, itype],
3535
[IntrArgMemOnly, NoCapture<ArgIndex<0>>, ImmArg<ArgIndex<4>>]>;
3636

3737
// We define 32-bit and 64-bit variants of the above, where T stands for i32
3838
// or i64 respectively:
39-
multiclass MaskedAtomicRMWFourArgIntrinsics {
39+
multiclass RISCVMaskedAtomicRMWFourArgIntrinsics {
4040
// i32 @llvm.<name>.i32.<p>(any*, i32, i32, i32 imm);
41-
def _i32 : MaskedAtomicRMWFourArg<llvm_i32_ty>;
41+
def _i32 : RISCVMaskedAtomicRMWFourArg<llvm_i32_ty>;
4242
// i64 @llvm.<name>.i32.<p>(any*, i64, i64, i64 imm);
43-
def _i64 : MaskedAtomicRMWFourArg<llvm_i64_ty>;
43+
def _i64 : RISCVMaskedAtomicRMWFourArg<llvm_i64_ty>;
4444
}
4545

46-
multiclass MaskedAtomicRMWFiveArgIntrinsics {
46+
multiclass RISCVMaskedAtomicRMWFiveArgIntrinsics {
4747
// i32 @llvm.<name>.i32.<p>(any*, i32, i32, i32, i32 imm);
48-
def _i32 : MaskedAtomicRMWFiveArg<llvm_i32_ty>;
48+
def _i32 : RISCVMaskedAtomicRMWFiveArg<llvm_i32_ty>;
4949
// i64 @llvm.<name>.i64.<p>(any*, i64, i64, i64, i64 imm);
50-
def _i64 : MaskedAtomicRMWFiveArg<llvm_i64_ty>;
50+
def _i64 : RISCVMaskedAtomicRMWFiveArg<llvm_i64_ty>;
5151
}
5252

5353
// These intrinsics are intended only for internal compiler use (i.e. as
@@ -56,21 +56,21 @@ let TargetPrefix = "riscv" in {
5656

5757
// @llvm.riscv.masked.atomicrmw.*.{i32,i64}.<p>(
5858
// ptr addr, ixlen oparg, ixlen mask, ixlenimm ordering)
59-
defm int_riscv_masked_atomicrmw_xchg : MaskedAtomicRMWFourArgIntrinsics;
60-
defm int_riscv_masked_atomicrmw_add : MaskedAtomicRMWFourArgIntrinsics;
61-
defm int_riscv_masked_atomicrmw_sub : MaskedAtomicRMWFourArgIntrinsics;
62-
defm int_riscv_masked_atomicrmw_nand : MaskedAtomicRMWFourArgIntrinsics;
63-
defm int_riscv_masked_atomicrmw_umax : MaskedAtomicRMWFourArgIntrinsics;
64-
defm int_riscv_masked_atomicrmw_umin : MaskedAtomicRMWFourArgIntrinsics;
59+
defm int_riscv_masked_atomicrmw_xchg : RISCVMaskedAtomicRMWFourArgIntrinsics;
60+
defm int_riscv_masked_atomicrmw_add : RISCVMaskedAtomicRMWFourArgIntrinsics;
61+
defm int_riscv_masked_atomicrmw_sub : RISCVMaskedAtomicRMWFourArgIntrinsics;
62+
defm int_riscv_masked_atomicrmw_nand : RISCVMaskedAtomicRMWFourArgIntrinsics;
63+
defm int_riscv_masked_atomicrmw_umax : RISCVMaskedAtomicRMWFourArgIntrinsics;
64+
defm int_riscv_masked_atomicrmw_umin : RISCVMaskedAtomicRMWFourArgIntrinsics;
6565
// Signed min and max need an extra operand to do sign extension with.
6666
// @llvm.riscv.masked.atomicrmw.{max,min}.{i32,i64}.<p>(
6767
// ptr addr, ixlen oparg, ixlen mask, ixlen shamt, ixlenimm ordering)
68-
defm int_riscv_masked_atomicrmw_max : MaskedAtomicRMWFiveArgIntrinsics;
69-
defm int_riscv_masked_atomicrmw_min : MaskedAtomicRMWFiveArgIntrinsics;
68+
defm int_riscv_masked_atomicrmw_max : RISCVMaskedAtomicRMWFiveArgIntrinsics;
69+
defm int_riscv_masked_atomicrmw_min : RISCVMaskedAtomicRMWFiveArgIntrinsics;
7070

7171
// @llvm.riscv.masked.cmpxchg.{i32,i64}.<p>(
7272
// ptr addr, ixlen cmpval, ixlen newval, ixlen mask, ixlenimm ordering)
73-
defm int_riscv_masked_cmpxchg : MaskedAtomicRMWFiveArgIntrinsics;
73+
defm int_riscv_masked_cmpxchg : RISCVMaskedAtomicRMWFiveArgIntrinsics;
7474

7575
} // TargetPrefix = "riscv"
7676

@@ -79,33 +79,33 @@ let TargetPrefix = "riscv" in {
7979

8080
let TargetPrefix = "riscv" in {
8181

82-
class BitManipGPRIntrinsics
82+
class RISCVBitManipGPRIntrinsics
8383
: DefaultAttrsIntrinsic<[llvm_any_ty],
8484
[LLVMMatchType<0>],
8585
[IntrNoMem, IntrSpeculatable]>;
86-
class BitManipGPRGPRIntrinsics
86+
class RISCVBitManipGPRGPRIntrinsics
8787
: DefaultAttrsIntrinsic<[llvm_any_ty],
8888
[LLVMMatchType<0>, LLVMMatchType<0>],
8989
[IntrNoMem, IntrSpeculatable]>;
9090

9191
// Zbb
92-
def int_riscv_orc_b : BitManipGPRIntrinsics;
92+
def int_riscv_orc_b : RISCVBitManipGPRIntrinsics;
9393

9494
// Zbc or Zbkc
95-
def int_riscv_clmul : BitManipGPRGPRIntrinsics;
96-
def int_riscv_clmulh : BitManipGPRGPRIntrinsics;
95+
def int_riscv_clmul : RISCVBitManipGPRGPRIntrinsics;
96+
def int_riscv_clmulh : RISCVBitManipGPRGPRIntrinsics;
9797

9898
// Zbc
99-
def int_riscv_clmulr : BitManipGPRGPRIntrinsics;
99+
def int_riscv_clmulr : RISCVBitManipGPRGPRIntrinsics;
100100

101101
// Zbkb
102-
def int_riscv_brev8 : BitManipGPRIntrinsics;
103-
def int_riscv_zip : BitManipGPRIntrinsics;
104-
def int_riscv_unzip : BitManipGPRIntrinsics;
102+
def int_riscv_brev8 : RISCVBitManipGPRIntrinsics;
103+
def int_riscv_zip : RISCVBitManipGPRIntrinsics;
104+
def int_riscv_unzip : RISCVBitManipGPRIntrinsics;
105105

106106
// Zbkx
107-
def int_riscv_xperm4 : BitManipGPRGPRIntrinsics;
108-
def int_riscv_xperm8 : BitManipGPRGPRIntrinsics;
107+
def int_riscv_xperm4 : RISCVBitManipGPRGPRIntrinsics;
108+
def int_riscv_xperm8 : RISCVBitManipGPRGPRIntrinsics;
109109
} // TargetPrefix = "riscv"
110110

111111
//===----------------------------------------------------------------------===//

llvm/include/llvm/IR/IntrinsicsRISCVXTHead.td

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
let TargetPrefix = "riscv" in {
1414

15-
class TH_VdotTernaryWideMasked
15+
class RISCV_TH_VdotTernaryWideMasked
1616
: DefaultAttrsIntrinsic< [llvm_anyvector_ty],
1717
[LLVMMatchType<0>, llvm_any_ty, llvm_anyvector_ty,
1818
LLVMScalarOrSameVectorWidth<2, llvm_i1_ty>,
@@ -22,13 +22,13 @@ let TargetPrefix = "riscv" in {
2222
let VLOperand = 4;
2323
}
2424

25-
multiclass TH_VdotTernaryWide {
25+
multiclass RISCV_TH_VdotTernaryWide {
2626
def "int_riscv_" # NAME : RISCVTernaryWideUnMasked;
27-
def "int_riscv_" # NAME # "_mask" : TH_VdotTernaryWideMasked;
27+
def "int_riscv_" # NAME # "_mask" : RISCV_TH_VdotTernaryWideMasked;
2828
}
2929

30-
defm th_vmaqa : TH_VdotTernaryWide;
31-
defm th_vmaqau : TH_VdotTernaryWide;
32-
defm th_vmaqasu : TH_VdotTernaryWide;
33-
defm th_vmaqaus : TH_VdotTernaryWide;
30+
defm th_vmaqa : RISCV_TH_VdotTernaryWide;
31+
defm th_vmaqau : RISCV_TH_VdotTernaryWide;
32+
defm th_vmaqasu : RISCV_TH_VdotTernaryWide;
33+
defm th_vmaqaus : RISCV_TH_VdotTernaryWide;
3434
}

0 commit comments

Comments
 (0)