[PATCH] D113787: [llvm-reduce] keep terminator instructions during ReduceGlobalVars
Dwight Guth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 15 10:32:07 PST 2021
dwightguth added a comment.
I actually just realized, I don't think what you suggested is going to work. If you replace all the uses of the variable with undefs but don't delete any instructions that rely on that undef, then you're going to be left with loads and stores to undef, which will trigger undefined behavior. As a result, any interestingness test that happens to execute the program is likely going to segfault and be uninteresting. As a result of which, many global variables will not be deleted even though they are not actually needed. I think it's better to leave this code as it is.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113787/new/
https://reviews.llvm.org/D113787
More information about the llvm-commits
mailing list