[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 28 May 2015 18:39:17 +0000 (18:39 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 28 May 2015 18:39:17 +0000 (18:39 +0000)
commit967f6ad3e1c4a01a9c1ce2ada91e07e396c7de19
treec4cd29b00d71c4e7a6165a35eee095510c3eb66e
parentef1de3295a543c18652a8fde532455c3a121b4fd
[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.

Currently we only fold a BitCast into a Load when the BitCast is its
only user.

Do the same for any no-op cast.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238452 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/load-bitcast32.ll [new file with mode: 0644]
test/Transforms/InstCombine/load-bitcast64.ll [new file with mode: 0644]