OSDN Git Service

InstCombine optimizes gep(bitcast(x)) even when the bitcasts casts away address
authorNadav Rotem <nadav.rotem@intel.com>
Tue, 5 Apr 2011 14:29:52 +0000 (14:29 +0000)
committerNadav Rotem <nadav.rotem@intel.com>
Tue, 5 Apr 2011 14:29:52 +0000 (14:29 +0000)
commit0286ca89f0734a81c273e80732a573f619c7ace4
treec664441ac594a8c2bf50a1b207a4933d08e33762
parent45c435a24a048c53714c2ebda74037befaf8725c
InstCombine optimizes gep(bitcast(x)) even when the bitcasts casts away address
space info. We crash with an assert in this case. This change checks that the
address space of the bitcasted pointer is the same as the gep ptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128884 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/gep-addrspace.ll [new file with mode: 0644]