[llvm] eb8d865 - [TableGen] Change getReg() == 0 to !getReg().isValid() in expandCheckInvalidRegOperand. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 22:45:36 PDT 2024


Author: Craig Topper
Date: 2024-09-21T22:37:28-07:00
New Revision: eb8d865c4465a98e754670b34a445b45bcd60282

URL: https://github.com/llvm/llvm-project/commit/eb8d865c4465a98e754670b34a445b45bcd60282
DIFF: https://github.com/llvm/llvm-project/commit/eb8d865c4465a98e754670b34a445b45bcd60282.diff

LOG: [TableGen] Change getReg() == 0 to !getReg().isValid() in expandCheckInvalidRegOperand. NFC

Added: 
    

Modified: 
    llvm/utils/TableGen/Common/PredicateExpander.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/Common/PredicateExpander.cpp b/llvm/utils/TableGen/Common/PredicateExpander.cpp
index 456c4cf5d92279..2afaa8cc21aa66 100644
--- a/llvm/utils/TableGen/Common/PredicateExpander.cpp
+++ b/llvm/utils/TableGen/Common/PredicateExpander.cpp
@@ -116,8 +116,10 @@ void PredicateExpander::expandCheckRegOperandSimple(raw_ostream &OS,
 
 void PredicateExpander::expandCheckInvalidRegOperand(raw_ostream &OS,
                                                      int OpIndex) {
+  if (!shouldNegate())
+    OS << "!";
   OS << "MI" << (isByRef() ? "." : "->") << "getOperand(" << OpIndex
-     << ").getReg() " << (shouldNegate() ? "!= " : "== ") << "0";
+     << ").getReg().isValid()";
 }
 
 void PredicateExpander::expandCheckSameRegOperand(raw_ostream &OS, int First,


        


More information about the llvm-commits mailing list