public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Fix floating point types.
@ 2021-11-16 9:46 Martin Liska
0 siblings, 0 replies; 4+ messages in thread
From: Martin Liska @ 2021-11-16 9:46 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:22b4cd9ce345983b76bf4d07226ceff6fe0286ab
commit 22b4cd9ce345983b76bf4d07226ceff6fe0286ab
Author: Martin Liska <mliska@suse.cz>
Date: Tue Nov 16 10:32:10 2021 +0100
Fix floating point types.
Diff:
---
gcc/tree-ssa-loop-unswitch.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 895b47b968e..e465e14a6ab 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -244,15 +244,20 @@ tree_may_unswitch_on (basic_block bb, class loop *loop, gimple_ranger *ranger)
return NULL;
}
- cond = build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ tree lhs = gimple_cond_lhs (stmt);
+ tree rhs = gimple_cond_rhs (stmt);
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node, lhs, rhs);
edge edge_true, edge_false;
extract_true_false_edges_from_block (bb, &edge_true, &edge_false);
unswitch_predicate *predicate = new unswitch_predicate (stmt, cond);
- ranger->range_on_edge (predicate->true_range, edge_true, gimple_cond_lhs (stmt));
- ranger->range_on_edge (predicate->false_range, edge_false, gimple_cond_lhs (stmt));
+ if (irange::supports_type_p (TREE_TYPE (lhs)))
+ {
+ ranger->range_on_edge (predicate->true_range, edge_true, lhs);
+ ranger->range_on_edge (predicate->false_range, edge_false, rhs);
+ }
+
return predicate;
}
@@ -278,7 +283,7 @@ simplify_using_entry_checks (unswitch_predicate *predicate,
&& operand_equal_p (gimple_cond_rhs (stmt),
TREE_OPERAND (cond, 1), 0))
return true_edge ? boolean_true_node : boolean_false_node;
- else
+ else if (irange::supports_type_p (TREE_TYPE (gimple_cond_lhs (stmt))))
{
int_range_max r;
irange &parent_range = (true_edge ? parent_predicate->true_range :
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Fix floating point types.
@ 2021-11-22 12:44 Martin Liska
0 siblings, 0 replies; 4+ messages in thread
From: Martin Liska @ 2021-11-22 12:44 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cc9dcdf4997c7e5db3f58832a1130081c661b7c2
commit cc9dcdf4997c7e5db3f58832a1130081c661b7c2
Author: Martin Liska <mliska@suse.cz>
Date: Tue Nov 16 10:32:10 2021 +0100
Fix floating point types.
Diff:
---
gcc/tree-ssa-loop-unswitch.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 895b47b968e..e465e14a6ab 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -244,15 +244,20 @@ tree_may_unswitch_on (basic_block bb, class loop *loop, gimple_ranger *ranger)
return NULL;
}
- cond = build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ tree lhs = gimple_cond_lhs (stmt);
+ tree rhs = gimple_cond_rhs (stmt);
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node, lhs, rhs);
edge edge_true, edge_false;
extract_true_false_edges_from_block (bb, &edge_true, &edge_false);
unswitch_predicate *predicate = new unswitch_predicate (stmt, cond);
- ranger->range_on_edge (predicate->true_range, edge_true, gimple_cond_lhs (stmt));
- ranger->range_on_edge (predicate->false_range, edge_false, gimple_cond_lhs (stmt));
+ if (irange::supports_type_p (TREE_TYPE (lhs)))
+ {
+ ranger->range_on_edge (predicate->true_range, edge_true, lhs);
+ ranger->range_on_edge (predicate->false_range, edge_false, rhs);
+ }
+
return predicate;
}
@@ -278,7 +283,7 @@ simplify_using_entry_checks (unswitch_predicate *predicate,
&& operand_equal_p (gimple_cond_rhs (stmt),
TREE_OPERAND (cond, 1), 0))
return true_edge ? boolean_true_node : boolean_false_node;
- else
+ else if (irange::supports_type_p (TREE_TYPE (gimple_cond_lhs (stmt))))
{
int_range_max r;
irange &parent_range = (true_edge ? parent_predicate->true_range :
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Fix floating point types.
@ 2021-11-19 14:34 Martin Liska
0 siblings, 0 replies; 4+ messages in thread
From: Martin Liska @ 2021-11-19 14:34 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:dfeca039098210ecb568bc5995261b58c4a3a3c0
commit dfeca039098210ecb568bc5995261b58c4a3a3c0
Author: Martin Liska <mliska@suse.cz>
Date: Tue Nov 16 10:32:10 2021 +0100
Fix floating point types.
Diff:
---
gcc/tree-ssa-loop-unswitch.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 895b47b968e..e465e14a6ab 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -244,15 +244,20 @@ tree_may_unswitch_on (basic_block bb, class loop *loop, gimple_ranger *ranger)
return NULL;
}
- cond = build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ tree lhs = gimple_cond_lhs (stmt);
+ tree rhs = gimple_cond_rhs (stmt);
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node, lhs, rhs);
edge edge_true, edge_false;
extract_true_false_edges_from_block (bb, &edge_true, &edge_false);
unswitch_predicate *predicate = new unswitch_predicate (stmt, cond);
- ranger->range_on_edge (predicate->true_range, edge_true, gimple_cond_lhs (stmt));
- ranger->range_on_edge (predicate->false_range, edge_false, gimple_cond_lhs (stmt));
+ if (irange::supports_type_p (TREE_TYPE (lhs)))
+ {
+ ranger->range_on_edge (predicate->true_range, edge_true, lhs);
+ ranger->range_on_edge (predicate->false_range, edge_false, rhs);
+ }
+
return predicate;
}
@@ -278,7 +283,7 @@ simplify_using_entry_checks (unswitch_predicate *predicate,
&& operand_equal_p (gimple_cond_rhs (stmt),
TREE_OPERAND (cond, 1), 0))
return true_edge ? boolean_true_node : boolean_false_node;
- else
+ else if (irange::supports_type_p (TREE_TYPE (gimple_cond_lhs (stmt))))
{
int_range_max r;
irange &parent_range = (true_edge ? parent_predicate->true_range :
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Fix floating point types.
@ 2021-11-19 13:53 Martin Liska
0 siblings, 0 replies; 4+ messages in thread
From: Martin Liska @ 2021-11-19 13:53 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:fe39426dd45d591a9337abf36eeb7b3053fcd758
commit fe39426dd45d591a9337abf36eeb7b3053fcd758
Author: Martin Liska <mliska@suse.cz>
Date: Tue Nov 16 10:32:10 2021 +0100
Fix floating point types.
Diff:
---
gcc/tree-ssa-loop-unswitch.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 895b47b968e..e465e14a6ab 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -244,15 +244,20 @@ tree_may_unswitch_on (basic_block bb, class loop *loop, gimple_ranger *ranger)
return NULL;
}
- cond = build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ tree lhs = gimple_cond_lhs (stmt);
+ tree rhs = gimple_cond_rhs (stmt);
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node, lhs, rhs);
edge edge_true, edge_false;
extract_true_false_edges_from_block (bb, &edge_true, &edge_false);
unswitch_predicate *predicate = new unswitch_predicate (stmt, cond);
- ranger->range_on_edge (predicate->true_range, edge_true, gimple_cond_lhs (stmt));
- ranger->range_on_edge (predicate->false_range, edge_false, gimple_cond_lhs (stmt));
+ if (irange::supports_type_p (TREE_TYPE (lhs)))
+ {
+ ranger->range_on_edge (predicate->true_range, edge_true, lhs);
+ ranger->range_on_edge (predicate->false_range, edge_false, rhs);
+ }
+
return predicate;
}
@@ -278,7 +283,7 @@ simplify_using_entry_checks (unswitch_predicate *predicate,
&& operand_equal_p (gimple_cond_rhs (stmt),
TREE_OPERAND (cond, 1), 0))
return true_edge ? boolean_true_node : boolean_false_node;
- else
+ else if (irange::supports_type_p (TREE_TYPE (gimple_cond_lhs (stmt))))
{
int_range_max r;
irange &parent_range = (true_edge ? parent_predicate->true_range :
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-22 12:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 9:46 [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Fix floating point types Martin Liska
2021-11-19 13:53 Martin Liska
2021-11-19 14:34 Martin Liska
2021-11-22 12:44 Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).