diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-05-16 14:26:41 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-05-30 08:43:23 -0700 |
commit | 45466eecf5ef669164c0922e5be8fd288b144886 (patch) | |
tree | 7efdbe9befafc1337527c3567ac6a2b2f3e46691 /gcc/tree-vectorizer.h | |
parent | 17cca3c43e2f496dcef0ba79e04979b49439e0c3 (diff) | |
download | gcc-45466eecf5ef669164c0922e5be8fd288b144886.zip gcc-45466eecf5ef669164c0922e5be8fd288b144886.tar.gz gcc-45466eecf5ef669164c0922e5be8fd288b144886.tar.bz2 |
Add a != MIN/MAX_VALUE_CST ? CST-+1 : a to minmax_from_comparison
This patch adds the support for match that was implemented for PR 87913 in phiopt.
It implements it by adding support to minmax_from_comparison for the check.
It uses the range information if available which allows to produce MIN/MAX expression
when comparing against the lower/upper bound of the range instead of lower/upper
of the type.
minmax-20.c is the new testcase which tests the ranges part.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* fold-const.cc (minmax_from_comparison): Add support for NE_EXPR.
* match.pd ((cond (cmp (convert1? x) c1) (convert2? x) c2) pattern):
Add ne as a possible cmp.
((a CMP b) ? minmax<a, c> : minmax<b, c> pattern): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/minmax-22.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions