diff options
author | David Green <david.green@arm.com> | 2024-03-18 20:18:49 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2024-03-18 20:18:49 +0000 |
commit | 18da51b2b227bcaee0efd13c4bc9ba408ea6b6e6 (patch) | |
tree | da5ce666b2ed63dfbb2f6de74ae367543acef4b0 | |
parent | 5265be11b1bbf5d744cf564dce91e789e2ab4c9e (diff) | |
download | llvm-18da51b2b227bcaee0efd13c4bc9ba408ea6b6e6.zip llvm-18da51b2b227bcaee0efd13c4bc9ba408ea6b6e6.tar.gz llvm-18da51b2b227bcaee0efd13c4bc9ba408ea6b6e6.tar.bz2 |
[CodeGen] More uses of LocationSize::beforeOrAfterPointer().
As an extension to #84751, this adds some extra uses of beforeOrAfterPointer()
instead of UnknownSize.
-rw-r--r-- | llvm/include/llvm/Analysis/MemoryLocation.h | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 | ||||
-rw-r--r-- | 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())); |