This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Fix implicit TypeSize->uint64_t conversion in TransformFPLoadStorePair
ClosedPublic

Authored by david-arm on Jul 10 2020, 9:55 AM.

Details

Summary

In DAGCombiner::TransformFPLoadStorePair we were dropping the scalable
property of TypeSize when trying to create an integer type of equivalent
size. In fact, this optimisation makes no sense for scalable types
since we don't know the size at compile time. I have changed the code
to bail out when encountering scalable type sizes.

I've added a test to

llvm/test/CodeGen/AArch64/sve-fp.ll

that exercises this code path. The test already emits an error if it
encounters warnings due to implicit TypeSize->uint64_t conversions.

Diff Detail

Event Timeline

david-arm created this revision.Jul 10 2020, 9:55 AM
efriedma accepted this revision.Jul 10 2020, 1:56 PM

LGTM

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
15760

Mixing early return and non-early-return like this is confusing. But I guess also orthogonal.

15763

The isFloatingPoint check here seems weird; it doesn't really make sense to handle float vectors, but not int vectors. But I guess that's orthogonal.

This revision is now accepted and ready to land.Jul 10 2020, 1:56 PM
This revision was automatically updated to reflect the committed changes.