[PATCH] D44519: Add llvm-exegesis tool.

Eugene Zelenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 06:16:58 PDT 2018


Eugene.Zelenko added inline comments.


================
Comment at: tools/llvm-exegesis/InMemoryAssembler.cpp:9
+//===----------------------------------------------------------------------===//
+#include "InMemoryAssembler.h"
+#include "llvm/ADT/SmallVector.h"
----------------
Please separate with empty line.


================
Comment at: tools/llvm-exegesis/InstructionSnippetGenerator.cpp:9
+//===----------------------------------------------------------------------===//
+#include "InstructionSnippetGenerator.h"
+#include "llvm/ADT/MapVector.h"
----------------
Please separate with empty line.


================
Comment at: tools/llvm-exegesis/Uops.cpp:209
+    // TODO(courbet): Tell the user about this decision.
+    const auto Regs = getGreedyAssignment(Vars);
+    if (Regs.empty()) {
----------------
It's better to specify type explicitly, since it's not obvious. Same in other places.


================
Comment at: tools/llvm-exegesis/Uops.cpp:210
+    const auto Regs = getGreedyAssignment(Vars);
+    if (Regs.empty()) {
+      return makeError("No feasible greedy assignment");
----------------
Brackets could be omitted.


================
Comment at: tools/llvm-exegesis/Uops.cpp:214
+    auto Inst = generateMCInst(InstrDesc, Vars, Regs);
+    if (!State.canAssemble(Inst)) {
+      return makeError("Cannot assemble greedy assignment");
----------------
Brackets could be omitted.


================
Comment at: tools/llvm-exegesis/Uops.cpp:223
+  Result.reserve(NumRepetitions);
+  for (unsigned i = 0; i < NumRepetitions; ++i) {
+    Result.push_back(Pattern[i % Pattern.size()]);
----------------
Brackets could be omitted.


Repository:
  rL LLVM

https://reviews.llvm.org/D44519





More information about the llvm-commits mailing list