Trivially rematerializable instructions are instructions that has no side effects and requires no operands that are not always available. The PPC instructions ADDIStocHA and ADDItocL are trivially rematerializable because it does a ADDIS/ADDI on the TOC register and an immediate. On PowerPC the ABI reserves the TOC register (X2) in any functions that have calls or access global variables.
Define target hook isReallyTriviallyReMaterializable() to explicitly specify PowerPC instructions that are trivially rematerializable. This will allow MachineLICM pass to accurately identify PPC instructions that should always be hoisted.
Spec 2006 Results (>1 indicates improvement):
SpeedUp | |
SPEC_INT | |
400.perlbench | 1.000 |
401.bzip2 | 1.000 |
403.gcc | 0.998 |
429.mcf | 1.009 |
445.gobmk | 1.005 |
456.hmmer | 1.001 |
458.sjeng | 1.011 |
462.libquantum | 1.006 |
464.h264ref | 1.044 |
471.omnetpp | 1.001 |
473.astar | 1.000 |
483.xalancbmk | 1.005 |
SPEC_FP | |
433.milc | 0.999 |
444.namd | 0.987 |
447.dealII | 1.000 |
450.soplex | 0.995 |
453.povray | 0.995 |
470.lbm | 0.996 |
482.sphinx3 | 1.001 |
This needs a comment as to why each of these need to be marked as rematerializable here rather than in the .td file.