[GVN] Don't coerce non-integral pointers to integers or vice versa
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 19 Apr 2017 18:21:09 +0000 (18:21 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 19 Apr 2017 18:21:09 +0000 (18:21 +0000)
commit5945447d84320a8361be006e63dc942862adac63
tree3863095ca4ef6f32ea7b25ab61c20486904cfbfb
parenta5b9d3c11ab4af36bcbdf189339271f776d6f381
[GVN] Don't coerce non-integral pointers to integers or vice versa

Summary:
See http://llvm.org/docs/LangRef.html#non-integral-pointer-type

The NewGVN test does not fail without these changes (perhaps it does
try to coerce pointers <-> integers to begin with?), but I added the
test case anyway.

Reviewers: dberlin

Subscribers: mcrosier, llvm-commits, Prazek

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

llvm-svn: 300730
llvm/lib/Transforms/Utils/VNCoercion.cpp
llvm/test/Transforms/GVN/non-integral-pointers.ll [new file with mode: 0644]
llvm/test/Transforms/NewGVN/non-integral-pointers.ll [new file with mode: 0644]