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

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 17:17:05 PDT 2025


================
@@ -1269,15 +1253,13 @@ 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);
+  if (!emitPredicateMatch(PS, EncodingID))
+    return;
----------------
jurahul wrote:

Done. Also, emitMCPredicateChecks seems to return false in some cases, so adding that case as well.

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


More information about the llvm-commits mailing list