Extend or truncate __ptr32/__ptr64 pointers when dereferenced.
authorAmy Huang <akhuang@google.com>
Mon, 11 May 2020 21:13:37 +0000 (14:13 -0700)
committerAmy Huang <akhuang@google.com>
Fri, 26 Jun 2020 20:33:54 +0000 (13:33 -0700)
commit8b59c26bf347be5d96487c89849c0c1108bb3c42
treea10d8db35147d38e54e5e3283e3ea7d0452cbaa9
parent903cf140d0118cf0d3f0f6f8967c6a20d9c5be6b
Extend or truncate __ptr32/__ptr64 pointers when dereferenced.

Summary:
A while ago I implemented the functionality to lower Microsoft __ptr32
and __ptr64 pointers, which are stored as 32-bit and 64-bit pointer
and are extended/truncated to the appropriate pointer size when
dereferenced.
This patch adds an addrspacecast to cast from the __ptr32/__ptr64
pointer to a default address space when dereferencing.

Bug: https://bugs.llvm.org/show_bug.cgi?id=42359

Reviewers: hans, arsenm, RKSimon

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81517
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
llvm/test/CodeGen/X86/mixed-ptr-sizes.ll