[llvm] [llvm][aarch64] Add support for the MS qualifiers __ptr32, __ptr64, _sptr, __uptr (PR #112793)
Daniel Paoliello via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 15:16:21 PDT 2024
================
@@ -23602,12 +23656,28 @@ static SDValue performSTORECombine(SDNode *N,
SDValue Value = ST->getValue();
SDValue Ptr = ST->getBasePtr();
EVT ValueVT = Value.getValueType();
+ EVT MemVT = ST->getMemoryVT();
+ const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+ SDLoc DL(ST);
auto hasValidElementTypeForFPTruncStore = [](EVT VT) {
EVT EltVT = VT.getVectorElementType();
return EltVT == MVT::f32 || EltVT == MVT::f64;
};
+ // Cast ptr32 and ptr64 pointers to the default address space before a store.
+ unsigned AddrSpace = ST->getAddressSpace();
+ if (AddrSpace == ARM64AS::PTR64 || AddrSpace == ARM64AS::PTR32_SPTR ||
+ AddrSpace == ARM64AS::PTR32_UPTR) {
+ MVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
+ if (PtrVT != Ptr.getSimpleValueType()) {
+ SDValue Cast = DAG.getAddrSpaceCast(DL, PtrVT, Ptr, AddrSpace, 0);
----------------
dpaoliello wrote:
Not sure what you mean: we're not changing the address space at this point - after this is handled, the source/dest address space of the operands is unchanged, we've just inserted the appropriate extend/truncation operation.
https://github.com/llvm/llvm-project/pull/112793
More information about the llvm-commits
mailing list