[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
Wed Oct 13 15:10:52 PDT 2021


aeubanks planned changes to this revision.
aeubanks added a comment.

In D110274#3061561 <https://reviews.llvm.org/D110274#3061561>, @Meinersbur wrote:

> @aeubanks Can I have enabled Undef values but reduce to zero constants too, in case Zero still triggers the bug, but not Undef? In my experience, constant one (for integers) also helped reducing further.
>
> What I have been using is a "reduce-to-one", "reduce-to-zero" and "reduce-to-undef" pass. reduce-to-one would not reduce anything that is already one, zero, or undef (to ensure we can reach a fixpoint). reduce-to-zero does not change anything that is already zero or undef. reduce-to-undef can reduce what is not already undef. To not have undef appear in the reduction output, I would just not run the reduce-to-undef pass.
>
> Thoughts?

Specifically for the reduce-operands pass I agree it would be much nicer to attempt to reduce to undef/1/0, probably in that order (so we get as many 0s as possible and as few undefs as possible).

This patch touches more than just reduce-operands though, and now I think in the other passes it probably doesn't matter as much exactly what we reduce things to since we'll clean things up in the reduce-operands pass. So I guess I've talked myself out of this patch.


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