]> granicus.if.org Git - llvm/commit
CodeGen: Let frame index value type match alloca addr space
authorYaxun Liu <Yaxun.Liu@amd.com>
Thu, 20 Apr 2017 18:15:34 +0000 (18:15 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Thu, 20 Apr 2017 18:15:34 +0000 (18:15 +0000)
commit1baa360f328c84e5dd843ab06080f5eea29a9b2f
treec4fd8dc4a1495b1a457afcfec0ca927fd44bbbca
parent4d00a6147fcb45668e6f06cc9d588c97c6d173f2
CodeGen: Let frame index value type match alloca addr space

Recently alloca address space has been added to data layout. Due to this
change, pointer returned by alloca may have different size as pointer in
address space 0.

However, currently the value type of frame index is assumed to be of the
same size as pointer in address space 0.

This patch fixes that.

Most targets assume alloca returning pointer in address space 0, which
is the default alloca address space. Therefore it is NFC for them.

AMDGCN target with amdgiz environment requires this change since it
assumes alloca returning pointer to addr space 5 and its size is 32,
which is different from the size of pointer in addr space 0 which is 64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300864 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/AMDGPU/frame-index-amdgiz.ll [new file with mode: 0644]