Skip to content

Commit

Permalink
[AArch64] Simplify legalizer info for G_JUMP_TABLE and G_BRJT. (#71962)
Browse files Browse the repository at this point in the history
Remove s64 as a valid type for G_JUMP_TABLE since I think it is always a
pointer?

Replace custom predicate for G_BRJT with a legalFor that checks 2 types.
  • Loading branch information
topperc committed Nov 18, 2023
1 parent 813aaf3 commit d5ab48e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,9 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
getActionDefinitionsBuilder(G_CONCAT_VECTORS)
.legalFor({{v4s32, v2s32}, {v8s16, v4s16}, {v16s8, v8s8}});

getActionDefinitionsBuilder(G_JUMP_TABLE).legalFor({{p0}, {s64}});
getActionDefinitionsBuilder(G_JUMP_TABLE).legalFor({p0});

getActionDefinitionsBuilder(G_BRJT).legalIf([=](const LegalityQuery &Query) {
return Query.Types[0] == p0 && Query.Types[1] == s64;
});
getActionDefinitionsBuilder(G_BRJT).legalFor({{p0, s64}});

getActionDefinitionsBuilder({G_DYN_STACKALLOC,
G_STACKSAVE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@
# DEBUG-NEXT: .. type index coverage check SKIPPED: no rules defined
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
# DEBUG-NEXT: G_BRJT (opcode {{[0-9]+}}): 2 type indices
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
# DEBUG-NEXT: G_INSERT_VECTOR_ELT (opcode {{[0-9]+}}): 3 type indices, 0 imm indices
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
Expand Down

0 comments on commit d5ab48e

Please sign in to comment.