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

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 09:41:19 PDT 2021


aeubanks added a comment.

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?


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