[llvm] [WIP][X86][tablgen] Auto-gen broadcast tables (PR #73654)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 07:00:10 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff a90e215dfbc99803b30904c521ac375ebe0ea271 d412c141417f1d0434b4e2627aca0d82e6255106 -- llvm/lib/Target/X86/X86InstrFoldTables.cpp llvm/utils/TableGen/X86FoldTablesEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
index 010240b18a..e0dce96906 100644
--- a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
+++ b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
@@ -625,7 +625,8 @@ void X86FoldTablesEmitter::run(raw_ostream &O) {
std::vector<const CodeGenInstruction *> &OpcRegInsts = RegInstsIt->second;
// Memory fold tables
- auto Match = find_if(OpcRegInsts, IsMatch(MemInst, /*IsBroadcast=*/false, Variant));
+ auto Match =
+ find_if(OpcRegInsts, IsMatch(MemInst, /*IsBroadcast=*/false, Variant));
if (Match != OpcRegInsts.end()) {
updateTables(FixUp(*Match), MemInst);
OpcRegInsts.erase(Match);
@@ -636,9 +637,12 @@ void X86FoldTablesEmitter::run(raw_ostream &O) {
if (MemInstName.contains("mb"))
continue;
RegInstsIt = RegInstsForBroadcast.find(Opc);
- assert(RegInstsIt != RegInstsForBroadcast.end() && "Unexpected control flow");
- std::vector<const CodeGenInstruction *> & OpcRegInstsForBroadcast = RegInstsIt->second;
- Match = find_if(OpcRegInstsForBroadcast, IsMatch(MemInst, /*IsBroadcast=*/true, Variant));
+ assert(RegInstsIt != RegInstsForBroadcast.end() &&
+ "Unexpected control flow");
+ std::vector<const CodeGenInstruction *> &OpcRegInstsForBroadcast =
+ RegInstsIt->second;
+ Match = find_if(OpcRegInstsForBroadcast,
+ IsMatch(MemInst, /*IsBroadcast=*/true, Variant));
if (Match != OpcRegInstsForBroadcast.end()) {
updateTables(FixUp(*Match), MemInst, 0, /*IsMannual=*/false,
/*IsBroadcast=*/true);
@@ -677,11 +681,11 @@ void X86FoldTablesEmitter::run(raw_ostream &O) {
PRINT_TABLE(Table2)
PRINT_TABLE(Table3)
PRINT_TABLE(Table4)
- //PRINT_TABLE(BroadcastTable0)
- //PRINT_TABLE(BroadcastTable1)
+ // PRINT_TABLE(BroadcastTable0)
+ // PRINT_TABLE(BroadcastTable1)
PRINT_TABLE(BroadcastTable2)
PRINT_TABLE(BroadcastTable3)
- //PRINT_TABLE(BroadcastTable4)
+ // PRINT_TABLE(BroadcastTable4)
}
static TableGen::Emitter::OptClass<X86FoldTablesEmitter>
``````````
</details>
https://github.com/llvm/llvm-project/pull/73654
More information about the llvm-commits
mailing list