[ConstantFolding] Support folding loads from a GlobalAlias
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 22 Jul 2015 22:29:30 +0000 (22:29 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 22 Jul 2015 22:29:30 +0000 (22:29 +0000)
commit1b072f2beb49345381cf7ea59498c8f6218788d7
tree764f37c56d8dc1aa7d50646a6534cee2cbb8bb70
parent186b8ca6dcd6af79eb2a74dc6b25cf5e01e65be6
[ConstantFolding] Support folding loads from a GlobalAlias

The MSVC ABI requires that we generate an alias for the vtable which
means looking through a GlobalAlias which cannot be overridden improves
our ability to devirtualize.

Found while investigating PR20801.

Patch by Andrew Zhogin!

Differential Revision: http://reviews.llvm.org/D11306

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242955 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ConstantFolding.cpp
test/Transforms/SCCP/global-alias-constprop.ll [new file with mode: 0644]