Skip to content

Commit f91e8d5

Browse files
committed
Revert "[llvm-exegesis] [AArch64] Resolving "not all operands are initialized by snippet generator" (#142529)"
This reverts commit 2e8ecf7. It is causing clang-aarch64-quick buildbot to fail. (see:https://lab.llvm.org/buildbot/#/builders/65/builds/22035)
1 parent 5cd7d81 commit f91e8d5

File tree

5 files changed

+2
-141
lines changed

5 files changed

+2
-141
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,6 @@ def move_vec_shift : Operand<i32> {
13271327
let PrintMethod = "printShifter";
13281328
let EncoderMethod = "getMoveVecShifterOpValue";
13291329
let ParserMatchClass = MoveVecShifterOperand;
1330-
let OperandType = "OPERAND_SHIFT_MSL";
1331-
let OperandNamespace = "AArch64";
13321330
}
13331331

13341332
let DiagnosticType = "AddSubSecondSource" in {

llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,15 @@ void initLLVMToCVRegMapping(MCRegisterInfo *MRI);
6565
bool isHForm(const MCInst &MI, const MCInstrInfo *MCII);
6666
bool isQForm(const MCInst &MI, const MCInstrInfo *MCII);
6767
bool isFpOrNEON(const MCInst &MI, const MCInstrInfo *MCII);
68-
} // namespace AArch64_MC
68+
}
6969

7070
namespace AArch64 {
7171
enum OperandType {
7272
OPERAND_IMPLICIT_IMM_0 = MCOI::OPERAND_FIRST_TARGET,
73-
OPERAND_SHIFT_MSL,
7473
};
7574
} // namespace AArch64
7675

77-
} // namespace llvm
76+
} // End llvm namespace
7877

7978
// Defines symbolic names for AArch64 registers. This defines a mapping from
8079
// register name to register number.

llvm/test/tools/llvm-exegesis/AArch64/error-resolution.s

Lines changed: 0 additions & 78 deletions
This file was deleted.

llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
119119
ExegesisAArch64Target()
120120
: ExegesisTarget(AArch64CpuPfmCounters, AArch64_MC::isOpcodeAvailable) {}
121121

122-
Error randomizeTargetMCOperand(const Instruction &Instr, const Variable &Var,
123-
MCOperand &AssignedValue,
124-
const BitVector &ForbiddenRegs) const override;
125-
126122
private:
127123
std::vector<MCInst> setRegTo(const MCSubtargetInfo &STI, MCRegister Reg,
128124
const APInt &Value) const override {
@@ -186,56 +182,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
186182
}
187183
};
188184

189-
Error ExegesisAArch64Target::randomizeTargetMCOperand(
190-
const Instruction &Instr, const Variable &Var, MCOperand &AssignedValue,
191-
const BitVector &ForbiddenRegs) const {
192-
const Operand &Op = Instr.getPrimaryOperand(Var);
193-
const auto OperandType = Op.getExplicitOperandInfo().OperandType;
194-
// NOTE: To resolve "Not all operands were initialized by snippet generator"
195-
// Requires OperandType to be defined for such opcode's operands in AArch64
196-
// tablegen files. And omit introduced OperandType(s).
197-
198-
// Hacky temporary fix works by defaulting all OPERAND_UNKNOWN to
199-
// immediate value 0, but this introduce illegal instruction error for below
200-
// system instructions will need to be omitted with OperandType or opcode
201-
// specific values to avoid generating invalid encodings or unreliable
202-
// benchmark results for these system-level instructions.
203-
// Implement opcode-specific immediate value handling for system instrs:
204-
// - MRS/MSR: Use valid system register encodings (e.g., NZCV, FPCR, FPSR)
205-
// - MSRpstatesvcrImm1: Use valid PSTATE field encodings (e.g., SPSel,
206-
// DAIFSet)
207-
// - SYSLxt/SYSxt: Use valid system instruction encodings with proper
208-
// CRn/CRm/op values
209-
// - UDF: Use valid undefined instruction immediate ranges (0-65535)
210-
211-
switch (OperandType) {
212-
// MSL (Masking Shift Left) imm operand for 32-bit splatted SIMD constants
213-
// Correspond to AArch64InstructionSelector::tryAdvSIMDModImm321s()
214-
case llvm::AArch64::OPERAND_SHIFT_MSL: {
215-
// There are two valid encodings:
216-
// - Type 7: imm at [15:8], [47:40], shift = 264 (0x108) → msl #8
217-
// - Type 8: imm at [23:16], [55:48], shift = 272 (0x110) → msl #16
218-
// Corresponds AArch64_AM::encodeAdvSIMDModImmType7()
219-
// But, v2s_msl and v4s_msl instructions accept either form,
220-
// Thus, Arbitrarily chosing 264 (msl #8) for simplicity.
221-
AssignedValue = MCOperand::createImm(264);
222-
return Error::success();
223-
}
224-
case llvm::AArch64::OPERAND_IMPLICIT_IMM_0:
225-
AssignedValue = MCOperand::createImm(0);
226-
return Error::success();
227-
case MCOI::OperandType::OPERAND_PCREL:
228-
AssignedValue = MCOperand::createImm(8);
229-
return Error::success();
230-
default:
231-
break;
232-
}
233-
234-
return make_error<Failure>(
235-
Twine("Unimplemented operand type: MCOI::OperandType:")
236-
.concat(Twine(static_cast<int>(OperandType))));
237-
}
238-
239185
} // namespace
240186

241187
static ExegesisTarget *getTheExegesisAArch64Target() {

llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ static Error randomizeMCOperand(const LLVMState &State,
276276
AssignedValue = MCOperand::createReg(randomBit(AllowedRegs));
277277
break;
278278
}
279-
/// Omit pc-relative operands to imm value based on the instruction
280-
case MCOI::OperandType::OPERAND_PCREL:
281-
return State.getExegesisTarget().randomizeTargetMCOperand(
282-
Instr, Var, AssignedValue, ForbiddenRegs);
283279
default:
284280
break;
285281
}

0 commit comments

Comments
 (0)