[TypeSize] Allow returning scalable size in implicit conversion to uint64_t
authorSander de Smalen <sander.desmalen@arm.com>
Fri, 13 Mar 2020 09:13:34 +0000 (09:13 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Sun, 15 Mar 2020 13:48:49 +0000 (13:48 +0000)
commit8105935d3aa98089f24b356ae782771d024d9174
treedf91cfdcd9d7b0cb3e4d257afa689da187a866bf
parent564180429818dd48f2fab970fdb42d172ebd2a5f
[TypeSize] Allow returning scalable size in implicit conversion to uint64_t

This patch removes compiler runtime assertions that ensure the implicit
conversion are only guaranteed to work for fixed-width vectors.

With the assert it would be impossible to get _anything_ to build until
the
entire codebase has been upgraded, even when the indiscriminate uses of
the size as uint64_t would work fine for both scalable and fixed-width
types.

This issue will need to be addressed differently, with build-time errors
rather than assertion failures, but that effort falls beyond the scope
of this patch.

Returning the scalable size and avoiding the assert in getFixedSize()
is a temporary stop-gap in order to use LLVM for compiling and using
the SVE ACLE intrinsics.

Reviewers: efriedma, huntergr, rovka, ctetreau, rengolin

Reviewed By: efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75297
llvm/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/include/llvm/Support/TypeSize.h
llvm/lib/Target/AMDGPU/AMDGPULibFunc.cpp