[llvm] [CodeGen] [AMDGPU] Support type-aware intrinsic feature checks (PR #205536)

Keshav Vinayak Jha via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 07:52:09 PDT 2026


================
@@ -54,6 +56,16 @@ static cl::opt<unsigned>
 
 GCNSubtarget::~GCNSubtarget() = default;
 
+StringRef GCNSubtarget::getRequiredTargetFeaturesForIntrinsic(
+    unsigned IntrinsicID, const FunctionType *FTy) const {
+  if (FTy && IntrinsicID == Intrinsic::amdgcn_ballot &&
+      FTy->getReturnType()->isIntegerTy(32))
+    return "wavefrontsize32";
+
----------------
keshavvinayak01 wrote:

Not sure I follow, which PR? Since llvm.amdgcn.ballot is one overloaded intrinsic ID, putting `wavefrontsize32` in TableGen would also reject the valid i64 wave64 overload. That's the point of this overloade, to let targets refine the feature expression.

https://github.com/llvm/llvm-project/pull/205536


More information about the llvm-commits mailing list