aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-05 16:05:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-05 16:05:07 +0100
commitcff1a1225d8750df872cada03b7957e4f1a6df98 (patch)
tree06691e29031c96b84fa08f1e8e39b986e0c7179a /gcc
parentd7c50d679ffafaf5e7ba105cea765a307f60e2f3 (diff)
downloadgcc-cff1a1225d8750df872cada03b7957e4f1a6df98.zip
gcc-cff1a1225d8750df872cada03b7957e4f1a6df98.tar.gz
gcc-cff1a1225d8750df872cada03b7957e4f1a6df98.tar.bz2
re PR tree-optimization/89570 (ICE in prepare_cmp_insn, at optabs.c:4001)
PR tree-optimization/89570 * match.pd (vec_cond into cond_op simplification): Don't use get_conditional_internal_fn, use as_internal_fn (cond_op). Co-Authored-By: Richard Sandiford <richard.sandiford@arm.com> From-SVN: r269391
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/match.pd34
2 files changed, 22 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d4e8cbe..b85b54c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-03-05 Jakub Jelinek <jakub@redhat.com>
+ Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/89570
+ * match.pd (vec_cond into cond_op simplification): Don't use
+ get_conditional_internal_fn, use as_internal_fn (cond_op).
+
2019-03-05 Wilco Dijkstra <wdijkstr@arm.com>
PR target/89222
diff --git a/gcc/match.pd b/gcc/match.pd
index 8bf6535..0d82bea 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -5176,24 +5176,26 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
if the target can do it in one go. This makes the operation conditional
on c, so could drop potentially-trapping arithmetic, but that's a valid
- simplification if the result of the operation isn't needed. */
+ simplification if the result of the operation isn't needed.
+
+ Avoid speculatively generating a stand-alone vector comparison
+ on targets that might not support them. Any target implementing
+ conditional internal functions must support the same comparisons
+ inside and outside a VEC_COND_EXPR. */
+
#if GIMPLE
(for uncond_op (UNCOND_BINARY)
cond_op (COND_BINARY)
(simplify
(vec_cond @0 (view_convert? (uncond_op@4 @1 @2)) @3)
- (with { tree op_type = TREE_TYPE (@4);
- internal_fn cond_fn = get_conditional_internal_fn (uncond_op); }
- (if (cond_fn != IFN_LAST
- && vectorized_internal_fn_supported_p (cond_fn, op_type)
+ (with { tree op_type = TREE_TYPE (@4); }
+ (if (vectorized_internal_fn_supported_p (as_internal_fn (cond_op), op_type)
&& element_precision (type) == element_precision (op_type))
(view_convert (cond_op @0 @1 @2 (view_convert:op_type @3))))))
(simplify
(vec_cond @0 @1 (view_convert? (uncond_op@4 @2 @3)))
- (with { tree op_type = TREE_TYPE (@4);
- internal_fn cond_fn = get_conditional_internal_fn (uncond_op); }
- (if (cond_fn != IFN_LAST
- && vectorized_internal_fn_supported_p (cond_fn, op_type)
+ (with { tree op_type = TREE_TYPE (@4); }
+ (if (vectorized_internal_fn_supported_p (as_internal_fn (cond_op), op_type)
&& element_precision (type) == element_precision (op_type))
(view_convert (cond_op (bit_not @0) @2 @3 (view_convert:op_type @1)))))))
@@ -5202,20 +5204,14 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
cond_op (COND_TERNARY)
(simplify
(vec_cond @0 (view_convert? (uncond_op@5 @1 @2 @3)) @4)
- (with { tree op_type = TREE_TYPE (@5);
- internal_fn cond_fn
- = get_conditional_internal_fn (as_internal_fn (uncond_op)); }
- (if (cond_fn != IFN_LAST
- && vectorized_internal_fn_supported_p (cond_fn, op_type)
+ (with { tree op_type = TREE_TYPE (@5); }
+ (if (vectorized_internal_fn_supported_p (as_internal_fn (cond_op), op_type)
&& element_precision (type) == element_precision (op_type))
(view_convert (cond_op @0 @1 @2 @3 (view_convert:op_type @4))))))
(simplify
(vec_cond @0 @1 (view_convert? (uncond_op@5 @2 @3 @4)))
- (with { tree op_type = TREE_TYPE (@5);
- internal_fn cond_fn
- = get_conditional_internal_fn (as_internal_fn (uncond_op)); }
- (if (cond_fn != IFN_LAST
- && vectorized_internal_fn_supported_p (cond_fn, op_type)
+ (with { tree op_type = TREE_TYPE (@5); }
+ (if (vectorized_internal_fn_supported_p (as_internal_fn (cond_op), op_type)
&& element_precision (type) == element_precision (op_type))
(view_convert (cond_op (bit_not @0) @2 @3 @4
(view_convert:op_type @1)))))))