[SROA] Enhance SROA to handle `addrspacecast`ed allocas
authorMichael Liao <michael.hliao@gmail.com>
Tue, 18 Jun 2019 17:58:49 +0000 (17:58 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Tue, 18 Jun 2019 17:58:49 +0000 (17:58 +0000)
commit76a149ef8187310a60fd20481fdb2a10c8ba968e
treee6b509b0336b6137c3e62c1445eed6212bae7967
parentb6e7108dcd6231ed5e9d8b9246541be15b6e4307
[SROA] Enhance SROA to handle `addrspacecast`ed allocas

Summary:
- After `addrspacecast` is allowed to be eliminated in SROA, the
  adjusting of storage pointer (from `alloca) needs to handle the
  potential different address spaces between the storage pointer (from
  alloca) and the pointer being used.

Reviewers: arsenm

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 363711
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/addrspacecast.ll