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

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 04:29:00 PDT 2026


================
@@ -340,6 +340,98 @@ bool MCSubtargetInfo::checkFeatures(StringRef FS) const {
   });
 }
 
+static bool hasFeature(StringRef Feature, const FeatureBitset &FeatureBits,
+                       ArrayRef<SubtargetFeatureKV> ProcFeatures) {
+  bool ShouldBeEnabled = true;
+  if (Feature.consume_front("+"))
+    ShouldBeEnabled = true;
+  else if (Feature.consume_front("-"))
----------------
Pierre-vh wrote:

```suggestion
  if (!Feature.consume_front("+") && Feature.consume_front("-"))
```

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


More information about the llvm-commits mailing list