[PATCH] D44839: [llvm-mca] Add flag -instruction-tables to print the theoretical resource pressure distribution for instructions (PR36874)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 24 04:13:06 PDT 2018


RKSimon added a comment.

I'm happy with this but that's because I asked for it.....

@craig.topper @courbet I'm guessing this will be alright for Intel targets as well when they get resource tests added - I don't think we've missed anything?



================
Comment at: tools/llvm-mca/InstructionTables.cpp:40
+      double Cycles = static_cast<double>(Resource.second.size());
+      if (!Cycles)
+        continue;
----------------
Better to test for Resource.second.empty() and create Cycles after the continue? Comparing floats with zero always makes me nervouse - even for trivial cases like this.


================
Comment at: tools/llvm-mca/llvm-mca.cpp:363
+    Printer->addView(
+        llvm::make_unique<mca::ResourcePressureView>(*STI, *IP, *S));
 
----------------
Commit this clang-format fix separately.


https://reviews.llvm.org/D44839





More information about the llvm-commits mailing list