Skip to content

Commit 18da51b

Browse files
committed
[CodeGen] More uses of LocationSize::beforeOrAfterPointer().
As an extension to #84751, this adds some extra uses of beforeOrAfterPointer() instead of UnknownSize.
1 parent 5265be1 commit 18da51b

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

llvm/include/llvm/Analysis/MemoryLocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class MemoryLocation {
298298
}
299299

300300
// Return the exact size if the exact size is known at compiletime,
301-
// otherwise return MemoryLocation::UnknownSize.
301+
// otherwise return LocationSize::beforeOrAfterPointer().
302302
static LocationSize getSizeOrUnknown(const TypeSize &T) {
303303
return T.isScalable() ? LocationSize::beforeOrAfterPointer()
304304
: LocationSize::precise(T.getFixedValue());

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8395,7 +8395,7 @@ SDValue SelectionDAG::getMemIntrinsicNode(
83958395
MachineMemOperand::Flags Flags, LocationSize Size,
83968396
const AAMDNodes &AAInfo) {
83978397
if (Size.hasValue() && MemVT.isScalableVector())
8398-
Size = MemoryLocation::UnknownSize;
8398+
Size = LocationSize::beforeOrAfterPointer();
83998399
else if (Size.hasValue() && !Size.getValue())
84008400
Size = LocationSize::precise(MemVT.getStoreSize());
84018401

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4858,9 +4858,7 @@ void SelectionDAGBuilder::visitMaskedScatter(const CallInst &I) {
48584858
unsigned AS = Ptr->getType()->getScalarType()->getPointerAddressSpace();
48594859
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
48604860
MachinePointerInfo(AS), MachineMemOperand::MOStore,
4861-
// TODO: Make MachineMemOperands aware of scalable
4862-
// vectors.
4863-
MemoryLocation::UnknownSize, Alignment, I.getAAMetadata());
4861+
LocationSize::beforeOrAfterPointer(), Alignment, I.getAAMetadata());
48644862
if (!UniformBase) {
48654863
Base = DAG.getConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout()));
48664864
Index = getValue(Ptr);
@@ -4962,9 +4960,7 @@ void SelectionDAGBuilder::visitMaskedGather(const CallInst &I) {
49624960
unsigned AS = Ptr->getType()->getScalarType()->getPointerAddressSpace();
49634961
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
49644962
MachinePointerInfo(AS), MachineMemOperand::MOLoad,
4965-
// TODO: Make MachineMemOperands aware of scalable
4966-
// vectors.
4967-
MemoryLocation::UnknownSize, Alignment, I.getAAMetadata(), Ranges);
4963+
LocationSize::beforeOrAfterPointer(), Alignment, I.getAAMetadata(), Ranges);
49684964

49694965
if (!UniformBase) {
49704966
Base = DAG.getConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout()));

0 commit comments

Comments
 (0)