aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorOCHyams <orlando.hyams@sony.com>2023-05-05 18:05:24 +0100
committerOCHyams <orlando.hyams@sony.com>2023-05-05 18:07:05 +0100
commitf9dba933c6de4083a1d68f649326982be8af0672 (patch)
tree6df1ac11fc4bbf3949dd839844735cb1f7e42c48 /llvm/lib/IR/DebugInfo.cpp
parent839469436afcbdf5bb6dc9b081b1bcf3a1b22fea (diff)
downloadllvm-f9dba933c6de4083a1d68f649326982be8af0672.zip
llvm-f9dba933c6de4083a1d68f649326982be8af0672.tar.gz
llvm-f9dba933c6de4083a1d68f649326982be8af0672.tar.bz2
[Assignment Tracking] Skip scalable vectors in declare-to-assign pass
Do not convert dbg.declares to dbg.assigns for variables backed by scalable vector allocas as this isn't yet supported. Reviewed By: jmorse Differential Revision: https://reviews.llvm.org/D149959
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 76feeca..9cef82e 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -2104,6 +2104,7 @@ bool AssignmentTrackingPass::runOnFunction(Function &F) {
return /*Changed*/ false;
bool Changed = false;
+ auto *DL = &F.getParent()->getDataLayout();
// Collect a map of {backing storage : dbg.declares} (currently "backing
// storage" is limited to Allocas). We'll use this to find dbg.declares to
// delete after running `trackAssignments`.
@@ -2128,13 +2129,15 @@ bool AssignmentTrackingPass::runOnFunction(Function &F) {
// FIXME: Skip VLAs for now (let these variables use dbg.declares).
if (!Alloca->isStaticAlloca())
continue;
+ // Similarly, skip scalable vectors (use dbg.declares instead).
+ if (auto Sz = Alloca->getAllocationSize(*DL); Sz && Sz->isScalable())
+ continue;
DbgDeclares[Alloca].insert(DDI);
Vars[Alloca].insert(VarRecord(DDI));
}
}
}
- auto DL = std::make_unique<DataLayout>(F.getParent());
// FIXME: Locals can be backed by caller allocas (sret, byval).
// Note: trackAssignments doesn't respect dbg.declare's IR positions (as it
// doesn't "understand" dbg.declares). However, this doesn't appear to break