[llvm] [NFC][DecoderEmitter] Predicate generation code cleanup (PR #158140)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 18:21:07 PDT 2025


================
@@ -1266,15 +1238,15 @@ unsigned DecoderTableBuilder::getPredicateIndex(StringRef Predicate) const {
 }
 
 void DecoderTableBuilder::emitPredicateTableEntry(unsigned EncodingID) const {
-  if (!doesOpcodeNeedPredicate(EncodingID))
-    return;
-
   // Build up the predicate string.
   SmallString<256> Predicate;
-  // FIXME: emitPredicateMatch() functions can take a buffer directly rather
-  // than a stream.
   raw_svector_ostream PS(Predicate);
   emitPredicateMatch(PS, EncodingID);
+  // Predicate being empty indicates that there are no predicates.
+  // Predicate being "false" indicate that there are predicates but with no
+  // AssemblerMatcherPredicate.
+  if (Predicate.empty() || Predicate == "false")
----------------
jurahul wrote:

Done

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


More information about the llvm-commits mailing list