[PATCH] D16977: [MachineScheduler / CalcSpillWeights] Try to utilize foldable operands better.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 02:18:21 PST 2016


jonpa created this revision.
jonpa added a subscriber: llvm-commits.
Herald added subscribers: qcolombet, MatzeB.

This patch was needed to get some tests to pass while working on mischeduling for SystemZ.
On a benchmark suite, this patch also increased "folded stack accesses" from 14528 to 14736.

I am curious to hear what other think about this as I am not myself sure this is necessarily the best
way of achieving these results. To get the regression tests to pass, the heuristic had to be placed
3rd last in the list of the heuristics. However, it may well be that nearly same general results would
could be had if placing it lower down...

--

    If an instrution has an equivalent instruction that instead of reading a
    register, reads a memory location, it would be better to spill that register
    since the reload of it can then be folded.
    
    This patch tries to improve MachineScheduler and CalcSpillWeigths in this
    direction, by using a new TargetInstrInfo virtual method hasFoldableOperand().
    
    SystemZ has already a map for such instructions (getMemOpcode()), which is
    used to implement this method.


http://reviews.llvm.org/D16977

Files:
  include/llvm/CodeGen/MachineScheduler.h
  include/llvm/Target/TargetInstrInfo.h
  lib/CodeGen/CalcSpillWeights.cpp
  lib/CodeGen/MachineScheduler.cpp
  lib/Target/SystemZ/SystemZInstrInfo.cpp
  lib/Target/SystemZ/SystemZInstrInfo.h
  lib/Target/SystemZ/SystemZSubtarget.cpp
  lib/Target/SystemZ/SystemZSubtarget.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16977.47168.patch
Type: text/x-patch
Size: 9277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160208/397b79e0/attachment.bin>


More information about the llvm-commits mailing list