[llvm] [llvm-exegesis] [AArch64] Resolving "not all operands are initialized by snippet generator" (PR #142529)

Lakshay Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 00:59:33 PDT 2025


================
@@ -229,6 +233,41 @@ class ExegesisAArch64Target : public ExegesisTarget {
   }
 };
 
+Error ExegesisAArch64Target::randomizeTargetMCOperand(
+    const Instruction &Instr, const Variable &Var, MCOperand &AssignedValue,
+    const BitVector &ForbiddenRegs) const {
+  const Operand &Op = Instr.getPrimaryOperand(Var);
+  const auto OperandType = Op.getExplicitOperandInfo().OperandType;
+  // TODO: Look into immediate values to be opcode specific for
+  // MRS, MSR, MSRpstatesvcrImm1, SYSLxt, SYSxt, UDF (illegal instruction)
+  switch (OperandType) {
+  case MCOI::OperandType::OPERAND_UNKNOWN: {
+    unsigned Opcode = Instr.getOpcode();
+    switch (Opcode) {
+    case AArch64::MOVIv2s_msl:
+    case AArch64::MOVIv4s_msl:
+    case AArch64::MVNIv2s_msl:
+    case AArch64::MVNIv4s_msl:
----------------
lakshayk-nv wrote:

Introduced two new operand kinds `OPERAND_MSL_SHIFT_2S` and `OPERAND_MSL_SHIFT_4S` in AArch64 backend. @davemgreen Thanks!

PS: Marking the `$shift` operand `case MCOI::OperandType::OPERAND_IMMEDIATE` will still lead us to write opcode specific switch case, differently handle `imm` (1st operand of `MOVI2s_msl`, etc.) and `$shift`  and further code flow changes in `randomizeTargetMCOperand()`. Thus, Favoured new operands introduction.



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


More information about the llvm-commits mailing list