[llvm] [AArch64][llvm] Gate some `tlbip` insns with either +tlbid or +d128 (PR #178913)

Jonathan Thackray via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 05:17:54 PDT 2026


================
@@ -4264,12 +4264,24 @@ bool AArch64AsmParser::parseSyspAlias(StringRef Name, SMLoc NameLoc,
     const AArch64TLBIP::TLBIP *TLBIP = AArch64TLBIP::lookupTLBIPByName(Op);
     if (!TLBIP)
       return TokError("invalid operand for TLBIP instruction");
-    if (!getSTI().hasFeature(AArch64::FeatureD128) &&
-        !getSTI().hasFeature(AArch64::FeatureAll))
-      return TokError("instruction requires: d128");
+
     if (!TLBIP->haveFeatures(getSTI().getFeatureBits())) {
+      FeatureBitset Active = getSTI().getFeatureBits();
+      FeatureBitset Missing = TLBIP->getRequiredFeatures() & ~Active;
+
+      bool NeedD128OrTLBID =
+          TLBIP->allowTLBID() &&
+          !(Active[AArch64::FeatureD128] || Active[AArch64::FeatureTLBID]);
+
       std::string Str("instruction requires: ");
-      setRequiredFeatureString(TLBIP->getRequiredFeatures(), Str);
+      if (Missing.any())
+        setRequiredFeatureString(Missing, Str);
+
+      if (NeedD128OrTLBID) {
+        if (Missing.any())
+          Str += ", ";
+        Str += "tlbid or d128";
+      }
----------------
jthackray wrote:

Okay, it's present upstream. Maybe this is another bug that needs sorting in a separate PR. I'll check the Arm ARM and get back to you.

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


More information about the llvm-commits mailing list