aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-match-head.c
diff options
context:
space:
mode:
authorprathamesh.kulkarni <prathamesh.kulkarni@linaro.org>2021-10-18 15:44:06 +0530
committerprathamesh.kulkarni <prathamesh.kulkarni@linaro.org>2021-10-18 15:44:06 +0530
commit20dcda98ed376cb61c74b2c71656f99c671ec9ce (patch)
tree7efcc5eb630088ec552f3e562ce4ee8ab625dca7 /gcc/gimple-match-head.c
parent85ce673378e7091ce603b033fac213a9d0d1f83a (diff)
downloadgcc-20dcda98ed376cb61c74b2c71656f99c671ec9ce.zip
gcc-20dcda98ed376cb61c74b2c71656f99c671ec9ce.tar.gz
gcc-20dcda98ed376cb61c74b2c71656f99c671ec9ce.tar.bz2
[sve] PR93183 - Add support for conditional neg.
gcc/ChangeLog: PR target/93183 * gimple-match-head.c (try_conditional_simplification): Add case for single operand. * internal-fn.def: Add entry for COND_NEG internal function. * internal-fn.c (FOR_EACH_CODE_MAPPING): Add entry for NEGATE_EXPR, COND_NEG mapping. * optabs.def: Add entry for cond_neg_optab. * match.pd (UNCOND_UNARY, COND_UNARY): New operator lists. (vec_cond COND (foo A) B) -> (IFN_COND_FOO COND A B): New pattern. (vec_cond COND B (foo A)) -> (IFN_COND_FOO ~COND A B): Likewise. gcc/testsuite/ChangeLog: PR target/93183 * gcc.target/aarch64/sve/cond_unary_4.c: Adjust. * gcc.target/aarch64/sve/pr93183.c: New test.
Diffstat (limited to 'gcc/gimple-match-head.c')
-rw-r--r--gcc/gimple-match-head.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index 7112c116..9d88b2f 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -870,6 +870,10 @@ try_conditional_simplification (internal_fn ifn, gimple_match_op *res_op,
memcpy (cond_op.ops, res_op->ops + 1, (num_ops - 1) * sizeof *cond_op.ops);
switch (num_ops - 2)
{
+ case 1:
+ if (!gimple_resimplify1 (seq, &cond_op, valueize))
+ return false;
+ break;
case 2:
if (!gimple_resimplify2 (seq, &cond_op, valueize))
return false;