[PATCH] D113787: [llvm-reduce] keep terminator instructions during ReduceGlobalVars

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 10:58:57 PST 2021


aeubanks added a comment.

In D113787#3132266 <https://reviews.llvm.org/D113787#3132266>, @dwightguth wrote:

> I genuinely don't understand the concern here. There are two types of common bugs in the llvm compiler. The first is when the compiler itself crashes. For this, all you need the interestingness test in llvm-reduce to do is run `llc` and report that it is interesting if the compiler crashes. In this case, you don't care what the program does when linked or executed, it's true. However, there is another type of common bug: namely, when the compiler miscompiles a program. In order to test whether the reduced program is interesting in this case, it's necessary to actually link and run it. Right now, llvm-reduce can be effectively used to reduce test cases that the compiler miscompiles. It's rather slow, but it works. If we make this change, it will no longer be able to effectively reduce global variables in this case because the reduced global variables will cause the attempts at reduction to segfault, rendering them uninteresting. As a result, the final reduced program will not be able to reduce any live global variables, which seems undesirable to me in a minimizer.

Basically every single delta pass does not preserve semantics, I'm very surprised that you're able to get anything useful to link. For example, arguably the most useful reduction, ReduceInstructions.cpp, RAUWs instructions with undef, which is clearly not semantics preserving in almost every case.


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