[PATCH] D47785: [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 6 05:33:25 PDT 2018
gchatelet added inline comments.
================
Comment at: tools/llvm-exegesis/lib/BenchmarkResult.cpp:44
+ assert(!String.empty());
+ // Starts with an uppercase, this is a Register.
+ if (std::isupper(String.front()))
----------------
courbet wrote:
> this won't work for arm/power.
As discussed, the registers are guaranteed to have a name (`MCRegisterInfo::getName`), these names are derived from the enums defined in `llvm/lib/Target/XXX/XXXGenRegisterInfo.inc.
Because they are valid identifier they have to start with a letter, LLVM convention defines enums in uppercase.
================
Comment at: tools/llvm-exegesis/lib/BenchmarkResult.cpp:47
+ return llvm::MCOperand::createReg(Context.getRegNo(String));
+ // There's a dot, this is a floating point.
+ if (String.count('.')) {
----------------
courbet wrote:
> Really ? :D
> Then use a custom format in serialize(), else this will not work. You also need to make sure that you're using the ansi C locale.
As discussed, I used an encoding scheme for numbers.
Repository:
rL LLVM
https://reviews.llvm.org/D47785
More information about the llvm-commits
mailing list