]>
git.ipfire.org Git - thirdparty/gcc.git/commit
match: Fix vcond into conditional op folding [PR113607].
In PR113607 we see an invalid fold of
_429 = .COND_SHL (mask_patt_205.47_276, vect_cst__262, vect_cst__262, { 0, ... });
vect_prephitmp_129.51_282 = _429;
vect_iftmp.55_287 = VEC_COND_EXPR <mask_patt_209.54_286, vect_prephitmp_129.51_282, vect_cst__262>;
to
Applying pattern match.pd:9607, gimple-match-10.cc:3817
gimple_simplified to vect_iftmp.55_287 = .COND_SHL (mask_patt_205.47_276, vect_cst__262, vect_cst__262, { 0, ... });
where we essentially use COND_SHL's else instead of VEC_COND_EXPR's.
This patch adjusts the corresponding match.pd pattern and makes it only
match when the else values are the same.
That, however, causes the exact test case for which this pattern was
introduced for to fail. Therefore XFAIL it for now.
gcc/ChangeLog:
PR middle-end/113607
* match.pd: Make sure else values match when folding a
vec_cond into a conditional operation.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/pre_cond_share_1.c: XFAIL.
* gcc.target/riscv/rvv/autovec/pr113607-run.c: New test.
* gcc.target/riscv/rvv/autovec/pr113607.c: New test.