[clang] [llvm] [llvm][AMDGPU] Fold `llvm.amdgcn.wavefrontsize` early (PR #114481)
Alex Voicu via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 18 08:59:10 PST 2024
================
@@ -1024,6 +1024,15 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
}
break;
}
+ case Intrinsic::amdgcn_wavefrontsize: {
+ // TODO: this is a workaround for the pseudo-generic target one gets with no
+ // specified mcpu, which spoofs its wave size to 64; it should be removed.
+ if ((ST->getCPU().empty() || ST->getCPU() == "generic") &&
+ !ST->getFeatureString().contains("+wavefrontsize"))
----------------
AlexVlx wrote:
Well, I don't think we should be doing live design of generic (which is part of what got us here anyway), so I'd rather not build even more technical debt around its current form which was meant to be a test only kludge:
```cpp
// The code produced for "generic" is only useful for tests and cannot
// reasonably be expected to execute on any particular target.
```
Which is to say I don't want to what is there now, I want it to not break. I've adjusted the check to cover `generic-hsa` and corrected the commit message.
https://github.com/llvm/llvm-project/pull/114481
More information about the cfe-commits
mailing list