[clang] [llvm] [RFC][CodeGen] Add generic target feature checks for intrinsics (PR #201470)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 07:59:04 PDT 2026


================
@@ -758,6 +758,14 @@ class TypeInfoGen<list<LLVMType> RetTypes, list<LLVMType> ParamTypes> {
 //  * ParamTypes is a list containing the parameter types expected for the
 //    intrinsic.
 //  * Properties can be set to describe the behavior of the intrinsic.
+//  * TargetFeatures is a target feature expression required by the intrinsic.
+//    The empty string means no target features are required. The expression
+//    uses feature names from the target's subtarget feature table. Comma means
+//    AND, | means OR, and parentheses group expressions. The special value
+//    "$custom" (Intrinsic::CustomTargetFeatures) indicates that support is
+//    decided by a target hook (TargetSubtargetInfo::isIntrinsicSupportedByTarget)
+//    rather than by evaluating a feature expression; use it when support depends
+//    on more than the subtarget features, e.g. a particular overload/mangling.
----------------
ssahasra wrote:

See my comment about `isIntrinsicSupportedByTarget()` below. I am just wondering do we really need `$custom` ... why can't we just always check the target!

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


More information about the llvm-commits mailing list