diff options
author | Jessica Paquette <jpaquette@apple.com> | 2018-03-16 22:53:34 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2018-03-16 22:53:34 +0000 |
commit | b3e7dc9144eee605a6456e6aef94a8e0a77c6cdb (patch) | |
tree | 400c87cd2943db7f7577e8d6745f1bc59463fcad /llvm/lib | |
parent | 961235d3352963cbe9efac946ec2f6ae9c14276c (diff) | |
download | bcm5719-llvm-b3e7dc9144eee605a6456e6aef94a8e0a77c6cdb.tar.gz bcm5719-llvm-b3e7dc9144eee605a6456e6aef94a8e0a77c6cdb.zip |
[MachineOutliner] Make KILLs invisible
At the point the outliner runs, KILLs don't impact anything, but they're still
considered unique instructions. This commit makes them invisible like
DebugValues so that they can still be outlined without impacting outlining
decisions.
llvm-svn: 327760
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index b4231d6ff05..0164905a3e0 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -5036,6 +5036,11 @@ AArch64InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT, // Don't allow debug values to impact outlining type. if (MI.isDebugValue() || MI.isIndirectDebugValue()) return MachineOutlinerInstrType::Invisible; + + // At this point, KILL instructions don't really tell us much so we can go + // ahead and skip over them. + if (MI.isKill()) + return MachineOutlinerInstrType::Invisible; // Is this a terminator for a basic block? if (MI.isTerminator()) { diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 11e0b68a664..3d92e742b87 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -11217,6 +11217,11 @@ X86InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags if (MI.isDebugValue() || MI.isIndirectDebugValue()) return MachineOutlinerInstrType::Invisible; + // At this point, KILL instructions don't really tell us much so we can go + // ahead and skip over them. + if (MI.isKill()) + return MachineOutlinerInstrType::Invisible; + // Is this a tail call? If yes, we can outline as a tail call. if (isTailCall(MI)) return MachineOutlinerInstrType::Legal; |