[GISel]: Fix incorrect IRTranslation while translating null pointer types
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 22 Mar 2018 17:31:38 +0000 (17:31 +0000)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 22 Mar 2018 17:31:38 +0000 (17:31 +0000)
commitb3297ef05179e1fee616b97b1c65b58e4c7fef17
treecc01c75bcbaef6fe86214965400e7c7bbc9725f1
parente5b51f6786f9846e8eab233df1bfa30c071297e1
[GISel]: Fix incorrect IRTranslation while translating null pointer types

https://reviews.llvm.org/D44762

Currently IRTranslator produces
%vreg17<def>(p0) = G_CONSTANT 0;

instead we should build
%vreg16(s64) = G_CONSTANT 0
%vreg17(p0) = G_INTTOPTR %vreg16

reviewed by @aemerson.

llvm-svn: 328218
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
llvm/test/CodeGen/AArch64/GlobalISel/translate-gep.ll