Optimize `
void f(const char *s) {
char a[256]; __builtin_strcpy(a, s); // dead store
}
to just empty function.
Paths
| Differential D88328
[InferAttrs] Improve DSE for libcalls (partial fix for PR47644) Needs ReviewPublic Authored by xbolva00 on Sep 25 2020, 12:06 PM.
Details
Summary Optimize ` char a[256]; __builtin_strcpy(a, s); // dead store } to just empty function.
Diff Detail
Unit TestsFailed
Event TimelineComment Actions Interestingly, as we can see, something is broken with NPM (hopefully not a blocker for this patch) Comment Actions I think it would be good to update the commit message to just state that this adds no capture and write only to the first arg of strcpy & co. It also unifies strcpy & stpcpy handling. might be good to do separately first.
Comment Actions
Ok. So first step: https://reviews.llvm.org/D88335 Comment Actions Needs a rebase.
Comment Actions Ok, I should be ready to make progress here again. @fhahn, with manually added writeonly, this optimization no longer works for me somehow. Any recent change in MSSA DSE which could cause this behaviour? Comment Actions
I think there was a change how lifetime.end is handled in MemorySSA. Adjusted DSE in f5cf7f544b7abe8488f76945537044f700b5548a.
Revision Contents
Diff 294393 llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/test/Transforms/InferFunctionAttrs/annotate.ll
llvm/test/Transforms/PhaseOrdering/dse-libcalls.ll
|
Can we just add those tests to llvm/test/Transforms/DeadStoreElimination/MSSA/libcalls.ll?