================
@@ -1336,6 +1311,59 @@ static void addPreloadKernArgHint(Function &F,
TargetMachine &TM) {
}
}
+static void checkWavesPerEU(Module &M, TargetMachine &TM) {
+ for (Function &F : M) {
+ const GCNSubtarget &ST = TM.getSubtarget<GCNSubtarget>(F);
+
+ auto FlatWgrpSizeAttr =
+ AMDGPU::getIntegerPairAttribute(F, "amdgpu-flat-work-group-size");
+ auto WavesPerEUAttr = AMDGPU::getIntegerPairAttribute(
+ F, "amdgpu-waves-per-eu", /*OnlyFirstRequired=*/true);
+
+ unsigned MinWavesPerEU = ST.getMinWavesPerEU();
+ unsigned MaxWavesPerEU = ST.getMaxWavesPerEU();
+
+ unsigned MinFlatWgrpSize = 1U;
+ unsigned MaxFlatWgrpSize = 1024U;
+ if (FlatWgrpSizeAttr.has_value()) {
+ MinFlatWgrpSize = FlatWgrpSizeAttr->first;
+ MaxFlatWgrpSize = *(FlatWgrpSizeAttr->second);
+ }
----------------
arsenm wrote:
```suggestion
if (FlatWgrpSizeAttr)
std::tie(MinFlatWgrpSize, MaxFlatWgrpSize) = *FlatWgrpSizeAttr;
```
https://github.com/llvm/llvm-project/pull/123995
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits