[PATCH] D141896: [TableGen][NFC] Add postfix for validators of CompressPat
Wang Pengcheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 22:34:35 PST 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfcc2e5aa3942: [TableGen][NFC] Add postfix for validators of CompressPat (authored by pcwang-thead).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141896/new/
https://reviews.llvm.org/D141896
Files:
llvm/utils/TableGen/CompressInstEmitter.cpp
Index: llvm/utils/TableGen/CompressInstEmitter.cpp
===================================================================
--- llvm/utils/TableGen/CompressInstEmitter.cpp
+++ llvm/utils/TableGen/CompressInstEmitter.cpp
@@ -638,6 +638,12 @@
EType == EmitterType::Compress || EType == EmitterType::CheckCompress;
bool CompressOrUncompress =
EType == EmitterType::Compress || EType == EmitterType::Uncompress;
+ std::string ValidatorName =
+ CompressOrUncompress
+ ? (TargetName + "ValidateMCOperandFor" +
+ (EType == EmitterType::Compress ? "Compress" : "Uncompress"))
+ .str()
+ : "";
for (auto &CompressPat : CompressPatterns) {
if (EType == EmitterType::Uncompress && CompressPat.IsCompressOnly)
@@ -774,7 +780,7 @@
getPredicates(MCOpPredicateMap, MCOpPredicates, DestOperand.Rec,
"MCOperandPredicate");
CondStream.indent(6)
- << TargetName << "ValidateMCOperand("
+ << ValidatorName << "("
<< "MI.getOperand(" << OpIdx << "), STI, " << Entry << ") &&\n";
} else {
unsigned Entry =
@@ -797,7 +803,7 @@
unsigned Entry = getPredicates(MCOpPredicateMap, MCOpPredicates,
DestOperand.Rec, "MCOperandPredicate");
CondStream.indent(6)
- << TargetName << "ValidateMCOperand("
+ << ValidatorName << "("
<< "MCOperand::createImm(" << DestOperandMap[OpNo].Data.Imm
<< "), STI, " << Entry << ") &&\n";
} else {
@@ -837,8 +843,7 @@
Func.indent(2) << "return false;\n}\n";
if (!MCOpPredicates.empty()) {
- o << "static bool " << TargetName
- << "ValidateMCOperand(const MCOperand &MCOp,\n"
+ o << "static bool " << ValidatorName << "(const MCOperand &MCOp,\n"
<< " const MCSubtargetInfo &STI,\n"
<< " unsigned PredicateIndex) {\n"
<< " switch (PredicateIndex) {\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141896.490041.patch
Type: text/x-patch
Size: 2062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230118/7866c586/attachment.bin>
More information about the llvm-commits
mailing list