[GlobalISel] Support vector-of-pointers in LLT
authorKristof Beyls <kristof.beyls@arm.com>
Wed, 19 Apr 2017 07:23:57 +0000 (07:23 +0000)
committerKristof Beyls <kristof.beyls@arm.com>
Wed, 19 Apr 2017 07:23:57 +0000 (07:23 +0000)
commit0f36e68f624f8ebe5fd6297bfd5b19819bf7ab21
treed2a28767ae1c100d133887b56e923624ae11e3c5
parent7a7135036382f02ba5fd900200833c79b27c066d
[GlobalISel] Support vector-of-pointers in LLT

This fixes PR32471.

As comment 10 on that bug report highlights
(https://bugs.llvm.org//show_bug.cgi?id=32471#c10), there are quite a
few different defendable design tradeoffs that could be made, including
not representing pointers at all in LLT.

I decided to go for representing vector-of-pointer as a concept in LLT,
while keeping the size of the LLT type 64 bits (this is an increase from
48 bits before). My rationale for keeping pointers explicit is that on
some targets probably it's very handy to have the distinction between
pointer and non-pointer (e.g. 68K has a different register bank for
pointers IIRC). If we keep a scalar pointer, it probably is easiest to
also have a vector-of-pointers to keep LLT relatively conceptually clean
and orthogonal, while we don't have a very strong reason to break that
orthogonality.  Once we gain more experience on the use of LLT, we can
of course reconsider this direction.

Rejecting vector-of-pointer types in the IRTranslator is also an option
to avoid the crash reported in PR32471, but that is only a very
short-term solution; also needs quite a bit of code tweaks in places,
and is probably fragile. Therefore I didn't consider this the best
option.

llvm-svn: 300664
llvm/include/llvm/Support/LowLevelTypeImpl.h
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
llvm/lib/CodeGen/LowLevelType.cpp
llvm/lib/Support/LowLevelType.cpp
llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
llvm/unittests/CodeGen/LowLevelTypeTest.cpp