summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-08-01 19:45:09 +0000
committerReid Kleckner <rnk@google.com>2017-08-01 19:45:09 +0000
commit29c675247d7dabd0859a3d9e3d59d19592f739a3 (patch)
tree2ae1f3c5e245fcf0426362a204e4a7c389006089 /llvm/lib/CodeGen/SelectionDAG
parent693ef999356086c09cb28a6f63763eafc46416f6 (diff)
downloadbcm5719-llvm-29c675247d7dabd0859a3d9e3d59d19592f739a3.tar.gz
bcm5719-llvm-29c675247d7dabd0859a3d9e3d59d19592f739a3.zip
[DebugInfo] Don't turn dbg.declare into DBG_VALUE for static allocas
Summary: We already have information about static alloca stack locations in our side table. Emitting instructions for them is inefficient, and it only happens when the address of the alloca has been materialized within the current block, which isn't often. Reviewers: aprantl, probinson, dblaikie Subscribers: jfb, dschuff, sbc100, jgravelle-google, hiraditya, llvm-commits, aheejin Differential Revision: https://reviews.llvm.org/D36117 llvm-svn: 309729
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 4e19ec32a3a..e90db4803ee 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5102,6 +5102,13 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
return nullptr;
}
+ // Static allocas are handled more efficiently in the variable frame index
+ // side table.
+ const auto *AI =
+ dyn_cast<AllocaInst>(Address->stripInBoundsConstantOffsets());
+ if (AI && AI->isStaticAlloca() && FuncInfo.StaticAllocaMap.count(AI))
+ return nullptr;
+
// Byval arguments with frame indices were already handled after argument
// lowering and before isel.
const auto *Arg =
OpenPOWER on IntegriCloud