[PATCH] D96978: [WIP] Bias statepoint operands towards spilling

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 20 01:07:14 PST 2021


skatkov added a comment.

The code looks good.



================
Comment at: llvm/lib/CodeGen/CalcSpillWeights.cpp:136
+  unsigned NumDefs = 0;
+  switch (MI.getOpcode()) {
+  default:
----------------
Not the first case I see this switch, may be it makes sense to extract to utility function.


================
Comment at: llvm/lib/CodeGen/CalcSpillWeights.cpp:157
+
+  for (unsigned i = 0, e = MI.getNumOperands(); i < e; ++i) {
+    MachineOperand &MO = MI.getOperand(i);
----------------
consider using findRegisterUseOperandIdx and findRegisterDefOperandIdx but might be it is an overhead.


================
Comment at: llvm/lib/CodeGen/CalcSpillWeights.cpp:289
 
+      // If all the uses could be folded at no cost, we don't care whether
+      // the live interval is on stack or in register for this instruction.
----------------
You could skip all thing above as you want weight == 0 anyway.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96978/new/

https://reviews.llvm.org/D96978



More information about the llvm-commits mailing list