[Constant Hoisting] Hoisting Constant GEP Expressions
authorZhaoshi Zheng <zhaoshiz@coduaurora.org>
Sat, 1 Sep 2018 00:04:56 +0000 (00:04 +0000)
committerZhaoshi Zheng <zhaoshiz@coduaurora.org>
Sat, 1 Sep 2018 00:04:56 +0000 (00:04 +0000)
commitf5297fb24bf0f21653e3fa855beb0a9e2ce81082
treee3e5220bf62b75fc1c75ad7f9020ebfef5f421af
parent78a10a7a9bb2d56a10dabae58ebd488055b1d828
[Constant Hoisting] Hoisting Constant GEP Expressions

Leverage existing logic in constant hoisting pass to transform constant GEP
expressions sharing the same base global variable. Multi-dimensional GEPs are
rewritten into single-dimensional GEPs.

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

llvm-svn: 341269
llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
llvm/test/CodeGen/AArch64/consthoist-gep.ll [new file with mode: 0644]
llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll [new file with mode: 0644]
llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll [new file with mode: 0644]
llvm/test/Transforms/ConstantHoisting/ARM/same-offset-multi-types.ll [new file with mode: 0644]