Skip to content

Commit 76c3eed

Browse files
authored
[AArch64][GlobalISel] Fix vector lrint/llrint fallbacks (#170814)
Add .lower() to vector lrint/llrint to enable lowering instead of falling back to SelectionDAG.
1 parent 5397221 commit 76c3eed

File tree

4 files changed

+3815
-2195
lines changed

4 files changed

+3815
-2195
lines changed

llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,15 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
450450
.legalFor({{s32, s32}, {s32, s64}, {s64, s32}, {s64, s64}})
451451
.legalFor(HasFP16, {{s32, s16}, {s64, s16}})
452452
.minScalar(1, s32)
453-
.libcallFor({{s64, s128}});
453+
.libcallFor({{s64, s128}})
454+
.lower();
454455
getActionDefinitionsBuilder({G_LLROUND, G_INTRINSIC_LLRINT})
455456
.legalFor({{s64, s32}, {s64, s64}})
456457
.legalFor(HasFP16, {{s64, s16}})
457458
.minScalar(0, s64)
458459
.minScalar(1, s32)
459-
.libcallFor({{s64, s128}});
460+
.libcallFor({{s64, s128}})
461+
.lower();
460462

461463
// TODO: Custom legalization for mismatched types.
462464
getActionDefinitionsBuilder(G_FCOPYSIGN)

llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@
188188
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
189189
# DEBUG-NEXT: G_INTRINSIC_LRINT (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
190190
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
191-
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
192-
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
191+
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
192+
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
193193
# DEBUG-NEXT: G_INTRINSIC_LLRINT (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
194194
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
195-
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
196-
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
195+
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
196+
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
197197
# DEBUG-NEXT: G_INTRINSIC_ROUNDEVEN (opcode {{[0-9]+}}): 1 type index, 0 imm indices
198198
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
199199
# DEBUG-NEXT: .. the first uncovered type index: 1, OK
@@ -696,11 +696,11 @@
696696
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
697697
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
698698
# DEBUG-NEXT: G_LROUND (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
699-
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
700-
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
699+
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
700+
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
701701
# DEBUG-NEXT: G_LLROUND (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
702-
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
703-
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
702+
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
703+
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
704704
# DEBUG-NEXT: G_BR (opcode {{[0-9]+}}): 0 type indices, 0 imm indices
705705
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
706706
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected

0 commit comments

Comments
 (0)