-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CodeGen] Use LocationSize for MMO getSize #84751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1026,18 +1026,27 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction { | |
/// MachineMemOperands are owned by the MachineFunction and need not be | ||
/// explicitly deallocated. | ||
MachineMemOperand *getMachineMemOperand( | ||
MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, | ||
MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, | ||
Align base_alignment, const AAMDNodes &AAInfo = AAMDNodes(), | ||
const MDNode *Ranges = nullptr, SyncScope::ID SSID = SyncScope::System, | ||
AtomicOrdering Ordering = AtomicOrdering::NotAtomic, | ||
AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic); | ||
|
||
MachineMemOperand *getMachineMemOperand( | ||
MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, | ||
Align base_alignment, const AAMDNodes &AAInfo = AAMDNodes(), | ||
MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, LocationSize Size, | ||
Align BaseAlignment, const AAMDNodes &AAInfo = AAMDNodes(), | ||
const MDNode *Ranges = nullptr, SyncScope::ID SSID = SyncScope::System, | ||
AtomicOrdering Ordering = AtomicOrdering::NotAtomic, | ||
AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic); | ||
MachineMemOperand *getMachineMemOperand( | ||
MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, uint64_t Size, | ||
Align BaseAlignment, const AAMDNodes &AAInfo = AAMDNodes(), | ||
const MDNode *Ranges = nullptr, SyncScope::ID SSID = SyncScope::System, | ||
AtomicOrdering Ordering = AtomicOrdering::NotAtomic, | ||
AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic) { | ||
return getMachineMemOperand(PtrInfo, F, LocationSize::precise(Size), | ||
BaseAlignment, AAInfo, Ranges, SSID, Ordering, | ||
FailureOrdering); | ||
} | ||
|
||
/// getMachineMemOperand - Allocate a new MachineMemOperand by copying | ||
/// an existing one, adjusting by an offset and using the given size. | ||
|
@@ -1046,9 +1055,16 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction { | |
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
int64_t Offset, LLT Ty); | ||
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
int64_t Offset, uint64_t Size) { | ||
int64_t Offset, LocationSize Size) { | ||
return getMachineMemOperand( | ||
MMO, Offset, Size == ~UINT64_C(0) ? LLT() : LLT::scalar(8 * Size)); | ||
MMO, Offset, | ||
!Size.hasValue() || Size.isScalable() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this just assert Size.hasValue()? I would assume if you have the unknown case you would have been using the LLT constructor in the first place There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think quite a lot of things will construct an MMO with an unknown LocationSize, either directly or from the size in another MMO that was already unknown. ~UINT64_C(0) and MemoryLocation::UnknownSize was used a lot in the past, they have all been changed to LocationSize::beforeOrAfterPointer() as the unknown Size. |
||
? LLT() | ||
: LLT::scalar(8 * Size.getValue().getKnownMinValue())); | ||
} | ||
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
int64_t Offset, uint64_t Size) { | ||
return getMachineMemOperand(MMO, Offset, LocationSize::precise(Size)); | ||
} | ||
|
||
/// getMachineMemOperand - Allocate a new MachineMemOperand by copying | ||
|
@@ -1057,10 +1073,15 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction { | |
/// explicitly deallocated. | ||
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
const MachinePointerInfo &PtrInfo, | ||
uint64_t Size); | ||
LocationSize Size); | ||
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
const MachinePointerInfo &PtrInfo, | ||
LLT Ty); | ||
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, | ||
const MachinePointerInfo &PtrInfo, | ||
uint64_t Size) { | ||
return getMachineMemOperand(MMO, PtrInfo, LocationSize::precise(Size)); | ||
} | ||
|
||
/// Allocate a new MachineMemOperand by copying an existing one, | ||
/// replacing only AliasAnalysis information. MachineMemOperands are owned | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should Size not be unsigned here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean it should be a TypeSize? I think this is a bit of code likely to need to change as GISel learns about scalable vectors (with the >=/<=). I think most of GISel should assume the memory sizes cannot be unknown for these nodes.