[llvm] [AMDGPU] Add lit64 machine verifier (PR #196457)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 10:30:27 PDT 2026


================
@@ -5289,6 +5285,19 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr &MI,
       }
       break;
     }
+    case AMDGPU::OPERAND_REG_IMM_FP64:
+    case AMDGPU::OPERAND_REG_IMM_INT64:
+    case AMDGPU::OPERAND_REG_IMM_V2INT32:
+    case AMDGPU::OPERAND_REG_IMM_V2FP32:
+      if (ST.has64BitLiterals() && Desc.getSize() != 4 && MO.isImm() &&
----------------
rampitec wrote:

It will fail verification on targets w/o lit64, AFAIR 87 failing tests. It will then check pseudos like `V_MOV__B64_PSEUDO` and complain about the immediate we cannot encode. For these targets we would split it in post-RA expansion, but with lit64 we will simply turn it into `V_MOV_B64`. The code is practically excerpt from `isOperandLegal()` along with the checks.

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


More information about the llvm-commits mailing list