Skip to content

Commit c82d650

Browse files
committed
Rollback hasFP16
1 parent b85fd55 commit c82d650

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
8989
const bool HasFP16 = ST.hasFullFP16();
9090
const LLT &MinFPScalar = HasFP16 ? s16 : s32;
9191

92-
// A legality predicate that returns true if the subtarget has FP16 support.
93-
// To be used in combination with other predicates, e.g:
94-
// .legalIf(all(hasFP16(), typeInSet(0, {v8s16, v4s16})))
95-
const auto hasFP16 = [=]() -> LegalityPredicate {
96-
return [=](const LegalityQuery &) { return HasFP16; };
97-
};
98-
9992
const bool HasCSSC = ST.hasCSSC();
10093
const bool HasRCPC3 = ST.hasRCPC3();
10194

@@ -267,10 +260,10 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
267260

268261
getActionDefinitionsBuilder(G_FABS)
269262
.legalFor({MinFPScalar, s32, s64, v2s32, v4s32, v2s64})
270-
.legalIf(all(hasFP16(), typeInSet(0, {v8s16, v4s16})))
271-
// TODO: Lower supports 128-bit types but G_AND generated by Lower does
272-
// not yet.
273-
// When it does, we can remove scalarizeIf.
263+
.legalIf([=](const LegalityQuery &Query) {
264+
const auto &Ty = Query.Types[0];
265+
return (Ty == v8s16 || Ty == v4s16) && HasFP16;
266+
})
274267
.scalarizeIf(scalarOrEltWiderThan(0, 64), 0)
275268
.lowerIf(scalarOrEltWiderThan(0, 64))
276269
.minScalarOrElt(0, MinFPScalar)

0 commit comments

Comments
 (0)