@@ -114,6 +114,18 @@ class AMDGPUCommonSubtarget {
114
114
return TargetTriple.getOS () == Triple::AMDPAL;
115
115
}
116
116
117
+ bool isMesa3DOS () const {
118
+ return TargetTriple.getOS () == Triple::Mesa3D;
119
+ }
120
+
121
+ bool isMesaKernel (const Function &F) const {
122
+ return isMesa3DOS () && !AMDGPU::isShader (F.getCallingConv ());
123
+ }
124
+
125
+ bool isAmdCodeObjectV2 (const Function &F) const {
126
+ return isAmdHsaOS () || isMesaKernel (F);
127
+ }
128
+
117
129
bool has16BitInsts () const {
118
130
return Has16BitInsts;
119
131
}
@@ -166,6 +178,12 @@ class AMDGPUCommonSubtarget {
166
178
return isAmdHsaOS () ? 8 : 4 ;
167
179
}
168
180
181
+ // / Returns the offset in bytes from the start of the input buffer
182
+ // / of the first explicit kernel argument.
183
+ unsigned getExplicitKernelArgOffset (const Function &F) const {
184
+ return isAmdCodeObjectV2 (F) ? 0 : 36 ;
185
+ }
186
+
169
187
// / \returns Maximum number of work groups per compute unit supported by the
170
188
// / subtarget and limited by given \p FlatWorkGroupSize.
171
189
unsigned getMaxWorkGroupsPerCU (unsigned FlatWorkGroupSize) const {
@@ -384,10 +402,6 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo,
384
402
385
403
void ParseSubtargetFeatures (StringRef CPU, StringRef FS);
386
404
387
- bool isMesa3DOS () const {
388
- return TargetTriple.getOS () == Triple::Mesa3D;
389
- }
390
-
391
405
Generation getGeneration () const {
392
406
return (Generation)Gen;
393
407
}
@@ -603,19 +617,11 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo,
603
617
return HasUnpackedD16VMem;
604
618
}
605
619
606
- bool isMesaKernel (const Function &F) const {
607
- return isMesa3DOS () && !AMDGPU::isShader (F.getCallingConv ());
608
- }
609
-
610
620
// Covers VS/PS/CS graphics shaders
611
621
bool isMesaGfxShader (const Function &F) const {
612
622
return isMesa3DOS () && AMDGPU::isShader (F.getCallingConv ());
613
623
}
614
624
615
- bool isAmdCodeObjectV2 (const Function &F) const {
616
- return isAmdHsaOS () || isMesaKernel (F);
617
- }
618
-
619
625
bool hasMad64_32 () const {
620
626
return getGeneration () >= SEA_ISLANDS;
621
627
}
@@ -652,12 +658,6 @@ class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo,
652
658
return D16PreservesUnusedBits;
653
659
}
654
660
655
- // / Returns the offset in bytes from the start of the input buffer
656
- // / of the first explicit kernel argument.
657
- unsigned getExplicitKernelArgOffset (const Function &F) const {
658
- return isAmdCodeObjectV2 (F) ? 0 : 36 ;
659
- }
660
-
661
661
// / \returns Number of bytes of arguments that are passed to a shader or
662
662
// / kernel in addition to the explicit ones declared for the function.
663
663
unsigned getImplicitArgNumBytes (const Function &F) const {
@@ -1088,10 +1088,6 @@ class R600Subtarget final : public R600GenSubtargetInfo,
1088
1088
1089
1089
bool hasFMA () const { return FMA; }
1090
1090
1091
- unsigned getExplicitKernelArgOffset (const MachineFunction &MF) const {
1092
- return 36 ;
1093
- }
1094
-
1095
1091
bool hasCFAluBug () const { return CFALUBug; }
1096
1092
1097
1093
bool hasVertexCache () const { return HasVertexCache; }
0 commit comments