This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix assert AArch64TargetLowering::ReplaceNodeResults
ClosedPublic

Authored by simonwallis2 on Aug 4 2021, 5:46 AM.

Details

Summary

Don't know how to custom expand this
UNREACHABLE executed at llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16788

The fix is to provide missing expansions for:

case ISD::STRICT_FP_TO_UINT:
case ISD::STRICT_FP_TO_SINT:

A test case is provided.

Diff Detail

Event Timeline

simonwallis2 created this revision.Aug 4 2021, 5:46 AM
simonwallis2 requested review of this revision.Aug 4 2021, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 5:46 AM
dmgreen added a subscriber: dmgreen.Aug 4 2021, 6:12 AM

Sounds OK to me, from a StrictFP perspective. I just have some test cleanup suggestions/nitpicks.

llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
1

It is commit in llc test to use -mtriple=aarch64-arm-none-eabi as opposed to the datalayout and triple below. But doesn't make a big difference either way.

5

I think you can remove "hidden", and usually "local_unnamed_addr #0"

8

Can we return "conv"? Otherwise something might decide to remove the instruction.

10

Add CHECK-LABEL, and maybe move before the test_fixtfti function? Or just use the update script.

23–24

Can probably remove these.

simonwallis2 marked 3 inline comments as done.Aug 4 2021, 6:41 AM
simonwallis2 added inline comments.
llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
10

OK I'll add some CHECK-LABELs.
Is there an advantage in moving before the test_fixfti function?
I'm not sure what update script you mean.

Updated test case, actioning most of the review comments.

dmgreen accepted this revision.Aug 4 2021, 7:46 AM
dmgreen added inline comments.
llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
10

It's just more standard - I would expect to find the check lines before the function, where you have added the CHECK-LABEL.

The update script is the llvm/utils/update_llc_test_checks.py script, which can fill in the check lines for you. In this case it won't make much difference, as it is already checking the important parts. For some tests that can change in the future it makes the tests easier to maintain.

I would move the CHECK line next to the CHECK-LABEL to keep them together. Otherwise LGTM.

This revision is now accepted and ready to land.Aug 4 2021, 7:46 AM
simonwallis2 marked an inline comment as done.

I have moved some CHECK lines around in the test case, as suggested by reviewer.

This revision was landed with ongoing or failed builds.Aug 4 2021, 8:19 AM
This revision was automatically updated to reflect the committed changes.
kpn added a subscriber: kpn.Aug 4 2021, 11:56 AM
kpn added inline comments.
llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
23–24

Removing the attributes is incorrect.

All functions that use the strictfp intrinsics require the strictfp attribute on the function definition.

In a function that uses the constrained intrinsics the strictfp attribute is required on all function calls.

This is in the Language Ref. It is not yet in the verifier because last time I tried it we had clang test failures.