[llvm] [llvm][aarch64] Add support for the MS qualifiers __ptr32, __ptr64, _sptr, __uptr (PR #112793)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 13:49:18 PDT 2024
================
@@ -587,11 +587,15 @@ class AArch64TargetLowering : public TargetLowering {
unsigned Depth) const override;
MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const override {
- // Returning i64 unconditionally here (i.e. even for ILP32) means that the
- // *DAG* representation of pointers will always be 64-bits. They will be
- // truncated and extended when transferred to memory, but the 64-bit DAG
- // allows us to use AArch64's addressing modes much more easily.
- return MVT::getIntegerVT(64);
+ if ((AS == ARM64AS::PTR32_SPTR) || (AS == ARM64AS::PTR32_UPTR)) {
+ return MVT::i32;
----------------
efriedma-quic wrote:
This probably deserves a more complete comment... specifically noting that these pointers are 32-bit, but they'll be converted to 64-bit pointers before isel.
https://github.com/llvm/llvm-project/pull/112793
More information about the llvm-commits
mailing list