This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Fix an assert fail/miscompile when fp16 types are copied to GPR register banks
ClosedPublic

Authored by aemerson on Feb 14 2018, 11:39 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Feb 14 2018, 11:39 AM
qcolombet accepted this revision.Feb 16 2018, 9:26 AM

Hi Amara,

Couple of nitpicks on the test case, but LGTM otherwise.
I believe we would need the same kind of fix for copies in the other direction.

Cheers,
-Quentin

lib/Target/AArch64/AArch64InstructionSelector.cpp
857 ↗(On Diff #134283)

I believe the part regarding insert should be its own separate patch.

test/CodeGen/AArch64/GlobalISel/pr36345-fp16-copy-gpr.mir
2 ↗(On Diff #134283)

Put the PR number in the comment, but not in the filename please.

69 ↗(On Diff #134283)

You can use -simplify-mir when you generate your .mir test case to get rid of all the cruft.
In particular, I don't think we need the preferred-registers part, the frameInfo, the stack and the IR could probably be shrunk.

This revision is now accepted and ready to land.Feb 16 2018, 9:26 AM

Thanks, I'll commit this with those changes and put up another patch shortly for the copies in the other direction.

This revision was automatically updated to reflect the committed changes.