Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Aug 20, 2025

In the AGPR case this will be an 8 byte instruction,
which is part of why this case is a pain to deal with in the
first place.

In the AGPR case this will be an 8 byte instruction,
which is part of why this case is a pain to deal with in the
first place.
Copy link
Contributor Author

arsenm commented Aug 20, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

In the AGPR case this will be an 8 byte instruction,
which is part of why this case is a pain to deal with in the
first place.


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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIInstructions.td (+2-1)
diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index bd5dfa92a8e43..d3c15bd8f672a 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -155,7 +155,8 @@ def AV_MOV_B32_IMM_PSEUDO
   let VOP3 = 1;
   let isMoveImm = 1;
   let SchedRW = [Write32Bit];
-  let Size = 4;
+  let Size = 8;
+  let FixedSize = true;
   let UseNamedOperandTable = 1;
 }
 

@arsenm arsenm marked this pull request as ready for review August 20, 2025 02:57
let SchedRW = [Write32Bit];
let Size = 4;
let Size = 8;
let FixedSize = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it is lowered to V_MOV_B32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be 4, but we need to report worst case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it affect code size calculation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but by the time we do anything with the size calculation these should have been expanded already. I'm not sure anything is using getInstSizeInBytes this early

@arsenm arsenm merged commit 0fa6fdf into main Aug 20, 2025
13 checks passed
@arsenm arsenm deleted the users/arsenm/amdgpu/correct-inst-size-av-mov-b32-imm-pseudo branch August 20, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants