[PATCH] D88287: [NARY-REASSOCIATE] Support reassociation of min/max
Nuno Lopes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 03:21:51 PST 2021
nlopes added a comment.
In D88287#2589841 <https://reviews.llvm.org/D88287#2589841>, @ebrevnov wrote:
> I think the solution is to use >= instead of > when we do min/max reassociation. In other words, originally we had 'any' > MAX_INT which is known to be false. If we want semantically equal but reassociated expression we should invert the comparison logic. In other words we should check MAX_INT >= 'any' which is known to be true and MAX_INT will be selected.
That's clever yes!
Alive2 says it's correct: https://alive2.llvm.org/ce/z/gieHpn
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88287/new/
https://reviews.llvm.org/D88287
More information about the llvm-commits
mailing list