This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Fix fptrunc store for fixed len vector
ClosedPublic

Authored by peterwaller-arm on Dec 6 2021, 9:41 AM.

Details

Summary

Restrict duplicate FP_EXTEND/FP_TRUNC -> LOAD/STORE DAG combines to only
larger than NEON types, as these are the ones for which there is custom
lowering.

Diff Detail

Event Timeline

peterwaller-arm created this revision.Dec 6 2021, 9:41 AM
peterwaller-arm requested review of this revision.Dec 6 2021, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2021, 9:41 AM
paulwalker-arm added inline comments.Dec 6 2021, 10:31 AM
llvm/test/CodeGen/AArch64/sve-fpext-load.ll
88–89 ↗(On Diff #392107)

sve-fixed-length-fp-extend-trunc.ll looks like a better home for this and the test below. In fact I believe we already have the makings of the required tests. See fcvt_v2f32_v2f64 and fcvt_v2f64_v2f32 within that file.

In general we don't use memory for the fixed length tests when the vector types are NEON sized. However, within sve-fixed-length-fp-extend-trunc.ll I think that is a mistake because these tests now validate multiple things, namely operation legalisation as well as the DAGCombines required for good code generation. This is likely how this bug has slipped through so for this patch can you instead update the tests within sve-fixed-length-fp-extend-trunc.ll so they all go through memory (it looks like there only 16 of them)?

  • Update tests per Paul's comments.
peterwaller-arm marked an inline comment as done.Dec 7 2021, 2:15 AM
paulwalker-arm added inline comments.Dec 7 2021, 2:31 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
15989–15990

Looking at the regressions in fcvt_v8f64_v8f32 and fcvt_v16f32_v16f16 I'm wondering if this wants to be >= instead?

  • Fix regressions per Paul's comment.
peterwaller-arm marked an inline comment as done.Dec 7 2021, 3:13 AM
paulwalker-arm accepted this revision.Dec 7 2021, 4:02 AM
This revision is now accepted and ready to land.Dec 7 2021, 4:02 AM