From 18da51b2b227bcaee0efd13c4bc9ba408ea6b6e6 Mon Sep 17 00:00:00 2001 From: David Green Date: Mon, 18 Mar 2024 20:18:49 +0000 Subject: [CodeGen] More uses of LocationSize::beforeOrAfterPointer(). As an extension to #84751, this adds some extra uses of beforeOrAfterPointer() instead of UnknownSize. --- llvm/include/llvm/Analysis/MemoryLocation.h | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/Analysis/MemoryLocation.h b/llvm/include/llvm/Analysis/MemoryLocation.h index 6d3d0ac..830eed5 100644 --- a/llvm/include/llvm/Analysis/MemoryLocation.h +++ b/llvm/include/llvm/Analysis/MemoryLocation.h @@ -298,7 +298,7 @@ public: } // Return the exact size if the exact size is known at compiletime, - // otherwise return MemoryLocation::UnknownSize. + // otherwise return LocationSize::beforeOrAfterPointer(). static LocationSize getSizeOrUnknown(const TypeSize &T) { return T.isScalable() ? LocationSize::beforeOrAfterPointer() : LocationSize::precise(T.getFixedValue()); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 2670f48..fc2517e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -8395,7 +8395,7 @@ SDValue SelectionDAG::getMemIntrinsicNode( MachineMemOperand::Flags Flags, LocationSize Size, const AAMDNodes &AAInfo) { if (Size.hasValue() && MemVT.isScalableVector()) - Size = MemoryLocation::UnknownSize; + Size = LocationSize::beforeOrAfterPointer(); else if (Size.hasValue() && !Size.getValue()) Size = LocationSize::precise(MemVT.getStoreSize()); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index f1923a6..8780f4b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4858,9 +4858,7 @@ void SelectionDAGBuilder::visitMaskedScatter(const CallInst &I) { unsigned AS = Ptr->getType()->getScalarType()->getPointerAddressSpace(); MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( MachinePointerInfo(AS), MachineMemOperand::MOStore, - // TODO: Make MachineMemOperands aware of scalable - // vectors. - MemoryLocation::UnknownSize, Alignment, I.getAAMetadata()); + LocationSize::beforeOrAfterPointer(), Alignment, I.getAAMetadata()); if (!UniformBase) { Base = DAG.getConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout())); Index = getValue(Ptr); @@ -4962,9 +4960,7 @@ void SelectionDAGBuilder::visitMaskedGather(const CallInst &I) { unsigned AS = Ptr->getType()->getScalarType()->getPointerAddressSpace(); MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( MachinePointerInfo(AS), MachineMemOperand::MOLoad, - // TODO: Make MachineMemOperands aware of scalable - // vectors. - MemoryLocation::UnknownSize, Alignment, I.getAAMetadata(), Ranges); + LocationSize::beforeOrAfterPointer(), Alignment, I.getAAMetadata(), Ranges); if (!UniformBase) { Base = DAG.getConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout())); -- cgit v1.1