[CGP] Make optimizeMemoryInst able to combine more kinds of ExtAddrMode fields
authorJohn Brawn <john.brawn@arm.com>
Fri, 24 Nov 2017 14:10:45 +0000 (14:10 +0000)
committerJohn Brawn <john.brawn@arm.com>
Fri, 24 Nov 2017 14:10:45 +0000 (14:10 +0000)
commit70cdb5b3914803ca89a96a867a47936d049a4b32
tree41ed4c542765843f1e4ca8864af8b42a937cea24
parent590f0793e8c7f25a7d993031436928823cd2c95a
[CGP] Make optimizeMemoryInst able to combine more kinds of ExtAddrMode fields

This patch extends the recent work in optimizeMemoryInst to make it able to
combine more ExtAddrMode fields than just the BaseReg.

This fixes some benchmark regressions introduced by r309397, where GVN PRE is
hoisting a getelementptr such that it can no longer be combined into the
addressing mode of the load or store that uses it.

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

llvm-svn: 318949
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/ARM/sink-addrmode.ll