[AMDGPU] Fix handling of void types in isLegalAddressingMode
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 15 May 2018 22:07:51 +0000 (22:07 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 15 May 2018 22:07:51 +0000 (22:07 +0000)
commit57d341c27adfdc13bbf49b068cded3404a26f0af
tree98595a2386819ec940752bdf1848a87e74bbd5a5
parent5455038d98b7c48e21603ef86200847834c0a086
[AMDGPU] Fix handling of void types in isLegalAddressingMode

It is legal for the type passed to isLegalAddressingMode to be
unsized or, more specifically, VoidTy. In this case, we must
check the legality of load / stores for all legal types. Directly
trying to call getTypeStoreSize is incorrect, and leads to breakage
in e.g. Loop Strength Reduction. This change guards against that
behaviour.

Differential Revision: https://reviews.llvm.org/D40405

llvm-svn: 332409
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/lsr-void.ll [new file with mode: 0644]