[PATCH] D97673: [RFC] [[Coroutine] [Debug] Salvage dbg.value at O2
Chuanqi Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 7 02:47:48 PDT 2021
ChuanqiXu updated this revision to Diff 335764.
ChuanqiXu added a comment.
Rebase with trunk and add option to control whether we would collect variables used only by dbg.vaues.
Although we can use materializing process to reduce the extra space, we can't prove we could get the same result with -g or not.
Previously, I think if we can't get the same result, the materialization part should take responsibility. However, I find that a pattern recently:
State before:
%a = alloca ...
; ... some uses who wouldn't cross suspend points
call to coro.suspend()
; ... alternative path
store %v to %a
dbg.value(metadata %v, dbg variable for %a, ...
Then after some optimization, the store in some path would be eliminated:
%a = alloca ...
; ... some uses who wouldn't cross suspend points
call to coro.suspend()
; ... alternative path
dbg.value(metadata %v, dbg variable for %a, ...
Then %a wouldn't be put into the frame before this patch. And it would be in the frame after this patch if we don't offer an option to control this. And materialization couldn't do much about this.
So I think the assumption before isn't solid, we should add option to control it indeed.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97673/new/
https://reviews.llvm.org/D97673
Files:
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/test/Transforms/Coroutines/coro-debug-O2.ll
llvm/test/Transforms/Coroutines/coro-debug-dbg.values-O2.ll
llvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll
llvm/test/Transforms/Coroutines/coro-debug.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97673.335764.patch
Type: text/x-patch
Size: 21497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/c3fc285c/attachment.bin>
More information about the llvm-commits
mailing list