[llvm] [AMDGPU] Set Size to 4 for V_MOV_B64_PSEUDO and S_MOV_B64_IMM_PSEUDO (PR #70376)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 14:47:06 PDT 2023


================
@@ -132,7 +132,7 @@ def V_MOV_B64_PSEUDO : VPseudoInstSI <(outs VReg_64:$vdst),
   let isAsCheapAsAMove = 1;
   let isMoveImm = 1;
   let SchedRW = [Write64Bit];
-  let Size = 16; // Needs maximum 2 v_mov_b32 instructions 8 byte long each.
+  let Size = 4;
----------------
rampitec wrote:

This is somewhat strange for a pseudo which is never encoded as is, but SIInstrInfo::getInstSizeInBytes() uses it as a baseline size. If it is not a fixed size instruction (and it is not) it will then add literal size to the base. The 16 we have now already count the literal (second time). Given that is a pseudo for expansion I'd prefer to use minimal possible size. 16 was written when we had no V_MOV_B64 and it was always expanded into a pair of V_MOV_B32, but even in that case it shall be 8.

https://github.com/llvm/llvm-project/pull/70376


More information about the llvm-commits mailing list