https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104401
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:6686e16fda419067b91614835dd743ebb82717ea commit r14-7124-g6686e16fda419067b91614835dd743ebb82717ea Author: liuhongt <hongtao....@intel.com> Date: Tue Dec 19 10:39:06 2023 +0800 Optimize A < B ? A : B to MIN_EXPR. Similar for A < B ? B : A to MAX_EXPR. There're codes in the frontend to optimize such pattern but failed to handle testcase in the PR since it's exposed at gimple level when folding backend builtins. pr95906 now can be optimized to MAX_EXPR as it's commented in the testcase. // FIXME: this should further optimize to a MAX_EXPR typedef signed char v16i8 __attribute__((vector_size(16))); v16i8 f(v16i8 a, v16i8 b) gcc/ChangeLog: PR target/104401 * match.pd (VEC_COND_EXPR: A < B ? A : B -> MIN_EXPR): New patten match. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104401.c: New test. * gcc.dg/tree-ssa/pr95906.c: Adjust testcase.