diff options
author | Fiona Glaser <escha@apple.com> | 2016-03-29 22:44:57 +0000 |
---|---|---|
committer | Fiona Glaser <escha@apple.com> | 2016-03-29 22:44:57 +0000 |
commit | 44a2f7a298db043bad5305a138520ad7aa68a95c (patch) | |
tree | 0ca28b256763ec6adbd09568882fee341bb945d7 /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 85fba393906dfa3e8e5da58b84dd7b242db22bbb (diff) | |
download | bcm5719-llvm-44a2f7a298db043bad5305a138520ad7aa68a95c.tar.gz bcm5719-llvm-44a2f7a298db043bad5305a138520ad7aa68a95c.zip |
MachineSink: make shouldSink a TII target hook
Some targets may disagree on what they want sunk or not sunk,
so make this a target hook instead of hardcoded.
llvm-svn: 264799
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 18aecdaba84..07fbd3d36ab 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -472,10 +472,6 @@ bool MachineSinking::PostponeSplitCriticalEdge(MachineInstr *MI, return true; } -static bool AvoidsSinking(MachineInstr *MI, MachineRegisterInfo *MRI) { - return MI->isInsertSubreg() || MI->isSubregToReg() || MI->isRegSequence(); -} - /// collectDebgValues - Scan instructions following MI and collect any /// matching DBG_VALUEs. static void collectDebugValues(MachineInstr *MI, @@ -724,9 +720,8 @@ static bool SinkingPreventsImplicitNullCheck(MachineInstr *MI, /// instruction out of its current block into a successor. bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore, AllSuccsCache &AllSuccessors) { - // Don't sink insert_subreg, subreg_to_reg, reg_sequence. These are meant to - // be close to the source to make it easier to coalesce. - if (AvoidsSinking(MI, MRI)) + // Don't sink instructions that the target prefers not to sink. + if (!TII->shouldSink(*MI)) return false; // Check if it's safe to move the instruction. |