[PATCH] D110274: [llvm-reduce] Add option to reduce values to zero instead of undef

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 02:26:40 PDT 2021


fhahn added a comment.

In D110274#3025013 <https://reviews.llvm.org/D110274#3025013>, @aeubanks wrote:

> In D110274#3023542 <https://reviews.llvm.org/D110274#3023542>, @Meinersbur wrote:
>
>> I was working on such a change myself.
>>
>> One remark here: Replacing a pointer by a NULL value can have a similar destructive effects like undef. When replacing an LoadInst or StoreInst address with NULL, it is introducing undefined behaviour where there was none before and make test cases reduced this way useless. Could we also optionally not replace pointers with null values? Similar though might also apply to the divisor of a divide/remainder operation.
>
> We can change the reduce operands pass to not reduce those specific operands, although that's orthogonal to this change since this change makes things more defined as null is more defined than undef.
>
>> I made a delta pass that converts these to function arguments instead and could upstream it.
>
> Yeah that sounds good. I'm worried that we'll end up creating functions with a ton of arguments, but we can land it and see if anybody complains.
> Or do you mean specifically convert load/store pointer operands and div/rem divisor operands to arguments?

@Meinersbur I think it would be great if you could share that patch.  I don't think adding arguments is a problem per-se, especially if it is limited to a small set of functions required in the final reproducer. One of the main benefits of replacing `undef` is reducing new sources of UB, which adding arguments would achieve. There also should be a couple of things we could do to try to keep the number of extra arguments in check, e.g. trying to re-use arguments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110274/new/

https://reviews.llvm.org/D110274



More information about the llvm-commits mailing list