[SVE][CodeGen] Fix implicit TypeSize->uint64_t conversion in TransformFPLoadStorePair
authorDavid Sherwood <david.sherwood@arm.com>
Fri, 10 Jul 2020 16:22:10 +0000 (17:22 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 14 Jul 2020 07:07:30 +0000 (08:07 +0100)
commit3b8eaf26db93fbb58db2478feb0f6234e9ad552a
tree7a1d6adde97ded81ec700b2dc541a0cd076f03c8
parente5f022cad99abb39d4f66b151a4a31a4ac063aff
[SVE][CodeGen] Fix implicit TypeSize->uint64_t conversion in TransformFPLoadStorePair

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.

Differential Revision: https://reviews.llvm.org/D83572
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/sve-fp.ll