[clang] [llvm] [RFC][CodeGen] Add generic target feature checks for intrinsics (PR #201470)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 30 01:28:47 PDT 2026
================
@@ -62,6 +63,18 @@ LLVM_ABI StringRef getName(ID id);
/// overloading, such as "llvm.ssa.copy".
LLVM_ABI StringRef getBaseName(ID id);
+/// \returns the target feature expression required by an intrinsic.
+LLVM_ABI StringRef getRequiredTargetFeatures(ID id);
+
+/// Sentinel value for an intrinsic's required-target-features string. When an
+/// intrinsic's \c TargetFeatures is set to this keyword, whether the intrinsic
+/// is supported is decided by a target-specific hook
+/// (TargetSubtargetInfo::isIntrinsicSupportedByTarget) rather than by
+/// evaluating a subtarget feature expression. Use it when support depends on
+/// more than the subtarget features, such as a particular overload/mangling or
+/// argument combination accepted by some targets but not others.
----------------
arsenm wrote:
I think for the subtarget specific operand rules, those should be restricted to immarg. And probably shouldn't be enforced by the verifier, either treat as UB or codegen error
https://github.com/llvm/llvm-project/pull/201470
More information about the cfe-commits
mailing list