Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Open
tclin914 wants to merge1 commit intollvm:main
base:main
Choose a base branch
Loading
fromtclin914:object-size-uint64_t

Conversation

tclin914
Copy link
Contributor

The type of the variable returned bygetObjectSize and set bysetObjectSize is uint64_t.

…and setObjectSize.The type of the variable returned by `getObjectSize` and set by`setObjectSize` is uint64_t.
@llvmbot
Copy link
Member

llvmbot commentedJul 17, 2025
edited
Loading

@llvm/pr-subscribers-backend-systemz

@llvm/pr-subscribers-llvm-selectiondag

Author: Jim Lin (tclin914)

Changes

The type of the variable returned bygetObjectSize and set bysetObjectSize is uint64_t.


Full diff:https://github.com/llvm/llvm-project/pull/149251.diff

4 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/MachineFrameInfo.h (+2-2)
  • (modified) llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp (+1-1)
  • (modified) llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp (+1-1)
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 ||

@arsenm
Copy link
Contributor

Generally immediates are encoded as int64_t. If we change this to anything it should probably be TypeSize

@RKSimonRKSimon requested a review fromtoppercJuly 17, 2025 08:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@arsenmarsenmAwaiting requested review from arsenm

@dvyukovdvyukovAwaiting requested review from dvyukov

@topperctoppercAwaiting requested review from topperc

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@tclin914@llvmbot@arsenm

[8]ページ先頭

©2009-2025 Movatter.jp