[llvm-commits] [llvm] r154477 - /llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Andrew Trick
atrick at apple.com
Tue Apr 10 21:31:33 PDT 2012
Author: atrick
Date: Tue Apr 10 23:31:33 2012
New Revision: 154477
URL: http://llvm.org/viewvc/llvm-project?rev=154477&view=rev
Log:
Tablegen'd regpressure: emit the weighted pressure limit.
Modified:
llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=154477&r1=154476&r2=154477&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Tue Apr 10 23:31:33 2012
@@ -152,7 +152,13 @@
<< "getRegPressureSetLimit(unsigned Idx) const {\n"
<< " static const unsigned PressureLimitTable[] = {\n";
for (unsigned i = 0; i < NumSets; ++i ) {
- OS << " " << RegBank.getRegPressureSet(i).Units.size()
+ const RegUnitSet &RegUnits = RegBank.getRegPressureSet(i);
+ unsigned Weight = 0;
+ for (RegUnitSet::iterator
+ I = RegUnits.Units.begin(), E = RegUnits.Units.end(); I != E; ++I) {
+ Weight += RegBank.getRegUnitWeight(*I);
+ }
+ OS << " " << Weight
<< ", \t// " << i << ": " << RegBank.getRegPressureSet(i).Name << "\n";
}
OS << " 0 };\n"
More information about the llvm-commits
mailing list