This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add fallback in FastISel fp16 conversions
ClosedPublic

Authored by ijsung on May 31 2017, 11:30 AM.

Details

Summary
  • Fix assertion failures on F16 to/from int types in FastISel by falling back to regular ISel
  • Add a testcase of various conversion cases with FastISel (-O0)

Diff Detail

Repository
rL LLVM

Event Timeline

ijsung created this revision.May 31 2017, 11:30 AM
pirama added subscribers: pirama, srhines.
ijsung updated this revision to Diff 100924.May 31 2017, 2:55 PM

Revise the testcase with FileCheck label name workarounds

Apparently FileCheck's CHECK-LABEL can get confused in non-obvious ways
if a label happen to be a prefix of other labels in some cases.

Revise label names of the tests to avoid confusing FileCheck; add a few
more checks.

kristof.beyls added a subscriber: SjoerdMeijer.
kristof.beyls added inline comments.
lib/Target/AArch64/AArch64FastISel.cpp
2857–2860 ↗(On Diff #100924)

It looks a bit strange to me that for selectFPToInt, the test is (SrcVT == MVT::f128 || SrcVT == MVT::f16) to fall back to DAGISel, while for selectIntToFP, the test is (DestVT == MVT::f16), not checking for a 128 bit floating point data type.
I guess this is because i128 is not a legal type for AArch64?

If my guess is correct, this change looks reasonable; otherwise I'm not entirely sure.

test/CodeGen/AArch64/arm64-fast-isel-conversion-fallback.ll
1 ↗(On Diff #100924)

I guess that -mcpu=cortex-a57 isn't needed in this test line?
For the actual tests, I think @SjoerdMeijer probably will be able to review them better than I can.

SjoerdMeijer added inline comments.Jun 1 2017, 3:44 AM
test/CodeGen/AArch64/arm64-fast-isel-conversion-fallback.ll
1 ↗(On Diff #100924)

The tests look very reasonable to me.

pirama added inline comments.Jun 1 2017, 10:50 AM
lib/Target/AArch64/AArch64FastISel.cpp
2857–2860 ↗(On Diff #100924)

isTypeLegal() (called in line 2855 above) returns false for f128. So both functions have matching behavior in that they don't handle f128.

ijsung updated this revision to Diff 101090.Jun 1 2017, 1:05 PM

Remove -mcpu=cortex-a57 in the testcase

Per suggestion from @kristof.beyls, -mcpu is not really necessary.

test/CodeGen/AArch64/arm64-fast-isel-conversion-fallback.ll
1 ↗(On Diff #100924)

Revised the RUN line and removed the -mcpu. Thanks.

SjoerdMeijer accepted this revision.Jun 8 2017, 2:32 AM

Looks good to me.

This revision is now accepted and ready to land.Jun 8 2017, 2:32 AM
This revision was automatically updated to reflect the committed changes.