summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-12-13 19:10:54 +0000
committerAdrian Prantl <aprantl@apple.com>2017-12-13 19:10:54 +0000
commit46af7316ea1d584e3e17604a7720300b9569d257 (patch)
tree67dc08d97795539e0e9e9e39c372eccf03c1bc8c /llvm/lib/CodeGen
parentce5930af5cb9e1e8e698765f9c5a9a5397b6d385 (diff)
downloadbcm5719-llvm-46af7316ea1d584e3e17604a7720300b9569d257.tar.gz
bcm5719-llvm-46af7316ea1d584e3e17604a7720300b9569d257.zip
Ignore metainstructions during the shrink wrap analysis
Shrink wrapping should ignore DBG_VALUEs referring to frame indices, since the presence of debug information must not affect code generation. Differential Revision: https://reviews.llvm.org/D41187 llvm-svn: 320606
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ShrinkWrap.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp
index ed01a90969d..2d9012978fd 100644
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -240,6 +240,10 @@ INITIALIZE_PASS_END(ShrinkWrap, DEBUG_TYPE, "Shrink Wrap Pass", false, false)
bool ShrinkWrap::useOrDefCSROrFI(const MachineInstr &MI,
RegScavenger *RS) const {
+ // Ignore DBG_VALUE and other meta instructions that must not affect codegen.
+ if (MI.isMetaInstruction())
+ return false;
+
if (MI.getOpcode() == FrameSetupOpcode ||
MI.getOpcode() == FrameDestroyOpcode) {
DEBUG(dbgs() << "Frame instruction: " << MI << '\n');
OpenPOWER on IntegriCloud