- Notifications
You must be signed in to change notification settings - Fork14.5k
[CodeGen] Change the type from int64_t to uint64_t for getObjectSize and setObjectSize#149251
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…and setObjectSize.The type of the variable returned by `getObjectSize` and set by`setObjectSize` is uint64_t.
llvmbot commentedJul 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@llvm/pr-subscribers-backend-systemz @llvm/pr-subscribers-llvm-selectiondag Author: Jim Lin (tclin914) ChangesThe type of the variable returned by Full diff:https://github.com/llvm/llvm-project/pull/149251.diff 4 Files Affected:
diff --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.hindex 403e5eda949f1..d672cef9ceefa 100644--- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h+++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h@@ -471,14 +471,14 @@ class MachineFrameInfo { } /// Return the size of the specified object.- int64_t getObjectSize(int ObjectIdx) const {+ uint64_t getObjectSize(int ObjectIdx) const { assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() && "Invalid Object Idx!"); return Objects[ObjectIdx+NumFixedObjects].Size; } /// Change the size of the specified stack object.- void setObjectSize(int ObjectIdx, int64_t Size) {+ void setObjectSize(int ObjectIdx, uint64_t Size) { assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() && "Invalid Object Idx!"); Objects[ObjectIdx+NumFixedObjects].Size = Size;diff --git a/llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp b/llvm/lib/CodeGen/SanitizerBinaryMetadata.cppindex 5cd35cc79d8a1..480e7b576a392 100644--- a/llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp+++ b/llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp@@ -84,7 +84,7 @@ bool MachineSanitizerBinaryMetadata::run(MachineFunction &MF) { if (!Features->getUniqueInteger()[kSanitizerBinaryMetadataUARBit]) return false; // Calculate size of stack args for the function.- int64_t Size = 0;+ uint64_t Size = 0; uint64_t Align = 0; const MachineFrameInfo &MFI = MF.getFrameInfo(); for (int i = -1; i >= (int)-MFI.getNumFixedObjects(); --i) {diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cppindex 80aeefe8e068a..919529c42da62 100644--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp@@ -394,7 +394,7 @@ spillIncomingStatepointValue(SDValue Incoming, SDValue Chain, MachineFrameInfo &MFI = Builder.DAG.getMachineFunction().getFrameInfo(); assert((MFI.getObjectSize(Index) * 8) == (-8 & (7 + // Round up modulo 8.- (int64_t)Incoming.getValueSizeInBits())) &&+ Incoming.getValueSizeInBits())) && "Bad spill: stack slot does not match!"); // Note: Using the alignment of the spill slot (rather than the abi ordiff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cppindex ae6ca55a36092..7efd59168ffd1 100644--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp@@ -404,7 +404,7 @@ bool SystemZInstrInfo::isStackSlotCopy(const MachineInstr &MI, return false; // Check that Length covers the full slots.- int64_t Length = MI.getOperand(2).getImm();+ uint64_t Length = MI.getOperand(2).getImm(); unsigned FI1 = MI.getOperand(0).getIndex(); unsigned FI2 = MI.getOperand(3).getIndex(); if (MFI.getObjectSize(FI1) != Length || |
Generally immediates are encoded as int64_t. If we change this to anything it should probably be TypeSize |
The type of the variable returned by
getObjectSize
and set bysetObjectSize
is uint64_t.