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

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 18 04:11:19 PST 2026


================
@@ -4267,20 +4267,22 @@ bool AArch64AsmParser::parseSyspAlias(StringRef Name, SMLoc NameLoc,
     const AArch64TLBIP::TLBIP *TLBIPorig = AArch64TLBIP::lookupTLBIPByName(Op);
     if (!TLBIPorig)
       return TokError("invalid operand for TLBIP instruction");
-    if (!getSTI().hasFeature(AArch64::FeatureD128) &&
-        !getSTI().hasFeature(AArch64::FeatureAll))
-      return TokError("instruction requires: d128");
     const AArch64TLBIP::TLBIP TLBIP(
         TLBIPorig->Name, TLBIPorig->Encoding | (HasnXSQualifier ? (1 << 7) : 0),
-        TLBIPorig->NeedsReg, TLBIPorig->OptionalReg,
+        TLBIPorig->NeedsReg, TLBIPorig->OptionalReg, TLBIPorig->AllowTLBID,
         HasnXSQualifier
             ? TLBIPorig->FeaturesRequired | FeatureBitset({AArch64::FeatureXS})
             : TLBIPorig->FeaturesRequired);
     if (!TLBIP.haveFeatures(getSTI().getFeatureBits())) {
----------------
Lukacma wrote:

If I am not missing smth, I think this whole logic can be simplified like this:
```
std::string Str("instruction requires: ");
FeatureBitset Missing = TLBIP.getRequiredFeatures() & ~Active;
setRequiredFeatureString(Missing, Str);
Str += "and d128"  TLBIP.allowTLBID() ? " or tlbid" : "" ;
``` 

I am also wondering if it might be better to have the check also return features that are missing so we don't need to get reuqired features again, but I am on the fence here so I am fine either way.

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


More information about the llvm-branch-commits mailing list