Skip to content

Commit 6b91320

Browse files
Addressing review comments
1 parent a42f173 commit 6b91320

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

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

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -109,51 +109,7 @@ static void appendCodeTemplates(const LLVMState &State,
109109
}
110110
case ExecutionMode::SERIAL_VIA_MEMORY_INSTR: {
111111
// Select back-to-back memory instruction.
112-
113-
auto &I = Variant.getInstr();
114-
if (I.Description.mayLoad()) {
115-
// If instruction is load, we can self-alias it in case when instruction
116-
// overrides whole address register. For that we use provided scratch
117-
// memory.
118-
119-
// TODO: now it is not checked if load writes the whole register.
120-
121-
auto DefOpIt = find_if(I.Operands, [](Operand const &op) {
122-
return op.isDef() && op.isReg();
123-
});
124-
125-
if (DefOpIt == I.Operands.end())
126-
return;
127-
128-
const Operand &DefOp = *DefOpIt;
129-
auto &ET = State.getExegesisTarget();
130-
auto ScratchMemoryRegister = ET.getScratchMemoryRegister(
131-
State.getTargetMachine().getTargetTriple());
132-
auto &RegClass =
133-
State.getTargetMachine().getMCRegisterInfo()->getRegClass(
134-
DefOp.getExplicitOperandInfo().RegClass);
135-
136-
// Register classes of def operand and memory operand must be the same
137-
// to perform aliasing.
138-
if (!RegClass.contains(ScratchMemoryRegister))
139-
return;
140-
141-
ET.fillMemoryOperands(Variant, ScratchMemoryRegister, 0);
142-
Variant.getValueFor(DefOp) = MCOperand::createReg(ScratchMemoryRegister);
143-
144-
CodeTemplate CT;
145-
CT.Execution = ExecutionModeBit;
146-
if (CT.ScratchSpacePointerInReg == 0)
147-
CT.ScratchSpacePointerInReg = ScratchMemoryRegister;
148-
149-
CT.Info = std::string(ExecutionClassDescription);
150-
CT.Instructions.push_back(std::move(Variant));
151-
CT.PreinitScratchMemory.emplace_back(ScratchMemoryRegister,
152-
/* Offset */ 0);
153-
CodeTemplates.push_back(std::move(CT));
154-
}
155-
156-
// TODO: implement more cases
112+
// TODO: Implement me.
157113
return;
158114
}
159115
case ExecutionMode::SERIAL_VIA_EXPLICIT_REGS: {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ class BenchmarkCodeStreamer : public MCStreamer, public AsmCommentConsumer {
208208
Align ByteAlignment, SMLoc Loc) override {}
209209

210210
unsigned findRegisterByName(const StringRef RegName) const {
211-
// TODO make use of RegNameToRegNo map
212-
if (unsigned Reg = Target.findRegisterByName(RegName))
213-
return Reg;
214211
std::optional<MCRegister> RegisterNumber =
215212
State.getRegisterNumberFromName(RegName);
216213
if (!RegisterNumber.has_value()) {

0 commit comments

Comments
 (0)