Skip to content

Commit eb8d865

Browse files
committed
[TableGen] Change getReg() == 0 to !getReg().isValid() in expandCheckInvalidRegOperand. NFC
1 parent bbca451 commit eb8d865

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/utils/TableGen/Common/PredicateExpander.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ void PredicateExpander::expandCheckRegOperandSimple(raw_ostream &OS,
116116

117117
void PredicateExpander::expandCheckInvalidRegOperand(raw_ostream &OS,
118118
int OpIndex) {
119+
if (!shouldNegate())
120+
OS << "!";
119121
OS << "MI" << (isByRef() ? "." : "->") << "getOperand(" << OpIndex
120-
<< ").getReg() " << (shouldNegate() ? "!= " : "== ") << "0";
122+
<< ").getReg().isValid()";
121123
}
122124

123125
void PredicateExpander::expandCheckSameRegOperand(raw_ostream &OS, int First,

0 commit comments

Comments
 (0)