gimple-ssa-evrp-analyze.h (class evrp_range_analyzer): Add m_update_global_ranges member.
* gimple-ssa-evrp-analyze.h (class evrp_range_analyzer): Add m_update_global_ranges member. Add corresponding argument to ctor. * gimple-ssa-evrp-analyze.c (evrp_range_analyzer::evrp_range_analyzer): Add new argument and initialize m_update_global_ranges. (evrp_range_analyzer::set_ssa_range_info): Assert that we are updating global ranges. (evrp_range_analyzer::record_ranges_from_incoming_edge): Only update global ranges if explicitly requested. (evrp_range_analyzer::record_ranges_from_phis): Similarly. (evrp_range_analyzer::record_ranges_from_stmt): Similarly. * gimple-ssa-evrp.c (evrp_dom_walker): Pass new argument to evrp_range_analyzer ctor. * gimple-ssa-sprintf.c (sprintf_dom_walker): Similarly. * tree-ssa-dom.c (dom_opt_dom_walker): Similarly. * gcc.c-torture/builtins/strnlen.x: New file to filter -Og from options to test. From-SVN: r266897
This commit is contained in:
parent
2d56d6ba9c
commit
c844c4028f
8 changed files with 57 additions and 5 deletions
|
@ -1,3 +1,22 @@
|
|||
2018-12-07 Jeff Law <law@redhat.com>
|
||||
|
||||
PR middle-end/87813
|
||||
* gimple-ssa-evrp-analyze.h (class evrp_range_analyzer): Add
|
||||
m_update_global_ranges member. Add corresponding argument to ctor.
|
||||
* gimple-ssa-evrp-analyze.c
|
||||
(evrp_range_analyzer::evrp_range_analyzer): Add new argument and
|
||||
initialize m_update_global_ranges.
|
||||
(evrp_range_analyzer::set_ssa_range_info): Assert that we are
|
||||
updating global ranges.
|
||||
(evrp_range_analyzer::record_ranges_from_incoming_edge): Only
|
||||
update global ranges if explicitly requested.
|
||||
(evrp_range_analyzer::record_ranges_from_phis): Similarly.
|
||||
(evrp_range_analyzer::record_ranges_from_stmt): Similarly.
|
||||
* gimple-ssa-evrp.c (evrp_dom_walker): Pass new argument to
|
||||
evrp_range_analyzer ctor.
|
||||
* gimple-ssa-sprintf.c (sprintf_dom_walker): Similarly.
|
||||
* tree-ssa-dom.c (dom_opt_dom_walker): Similarly.
|
||||
|
||||
2018-12-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
* config/aarch64/aarch64-opts.h (aarch64_sve_vector_bits_enum):
|
||||
|
|
|
@ -42,7 +42,8 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "vr-values.h"
|
||||
#include "gimple-ssa-evrp-analyze.h"
|
||||
|
||||
evrp_range_analyzer::evrp_range_analyzer () : stack (10)
|
||||
evrp_range_analyzer::evrp_range_analyzer (bool update_global_ranges)
|
||||
: stack (10), m_update_global_ranges (update_global_ranges)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
@ -107,6 +108,8 @@ evrp_range_analyzer::try_find_new_range (tree name,
|
|||
void
|
||||
evrp_range_analyzer::set_ssa_range_info (tree lhs, value_range *vr)
|
||||
{
|
||||
gcc_assert (m_update_global_ranges);
|
||||
|
||||
/* Set the SSA with the value range. */
|
||||
if (INTEGRAL_TYPE_P (TREE_TYPE (lhs)))
|
||||
{
|
||||
|
@ -213,6 +216,7 @@ evrp_range_analyzer::record_ranges_from_incoming_edge (basic_block bb)
|
|||
continue;
|
||||
push_value_range (vrs[i].first, vrs[i].second);
|
||||
if (is_fallthru
|
||||
&& m_update_global_ranges
|
||||
&& all_uses_feed_or_dominated_by_stmt (vrs[i].first, stmt))
|
||||
{
|
||||
set_ssa_range_info (vrs[i].first, vrs[i].second);
|
||||
|
@ -267,7 +271,8 @@ evrp_range_analyzer::record_ranges_from_phis (basic_block bb)
|
|||
vr_values->update_value_range (lhs, &vr_result);
|
||||
|
||||
/* Set the SSA with the value range. */
|
||||
set_ssa_range_info (lhs, &vr_result);
|
||||
if (m_update_global_ranges)
|
||||
set_ssa_range_info (lhs, &vr_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,7 +314,8 @@ evrp_range_analyzer::record_ranges_from_stmt (gimple *stmt, bool temporary)
|
|||
/* Case one. We can just update the underlying range
|
||||
information as well as the global information. */
|
||||
vr_values->update_value_range (output, &vr);
|
||||
set_ssa_range_info (output, &vr);
|
||||
if (m_update_global_ranges)
|
||||
set_ssa_range_info (output, &vr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
class evrp_range_analyzer
|
||||
{
|
||||
public:
|
||||
evrp_range_analyzer (void);
|
||||
evrp_range_analyzer (bool update_global_ranges);
|
||||
~evrp_range_analyzer (void)
|
||||
{
|
||||
delete vr_values;
|
||||
|
@ -70,6 +70,9 @@ class evrp_range_analyzer
|
|||
|
||||
/* STACK holds the old VR. */
|
||||
auto_vec<std::pair <tree, value_range*> > stack;
|
||||
|
||||
/* True if we are updating global ranges, false otherwise. */
|
||||
bool m_update_global_ranges;
|
||||
};
|
||||
|
||||
#endif /* GCC_GIMPLE_SSA_EVRP_ANALYZE_H */
|
||||
|
|
|
@ -70,6 +70,7 @@ class evrp_dom_walker : public dom_walker
|
|||
public:
|
||||
evrp_dom_walker ()
|
||||
: dom_walker (CDI_DOMINATORS),
|
||||
evrp_range_analyzer (true),
|
||||
evrp_folder (evrp_range_analyzer.get_vr_values ())
|
||||
{
|
||||
need_eh_cleanup = BITMAP_ALLOC (NULL);
|
||||
|
|
|
@ -121,7 +121,9 @@ struct format_result;
|
|||
class sprintf_dom_walker : public dom_walker
|
||||
{
|
||||
public:
|
||||
sprintf_dom_walker () : dom_walker (CDI_DOMINATORS) {}
|
||||
sprintf_dom_walker ()
|
||||
: dom_walker (CDI_DOMINATORS),
|
||||
evrp_range_analyzer (false) {}
|
||||
~sprintf_dom_walker () {}
|
||||
|
||||
edge before_dom_children (basic_block) FINAL OVERRIDE;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2018-12-07 Jeff Law <law@redhat.com>
|
||||
|
||||
PR middle-end/87813
|
||||
* gcc.c-torture/builtins/strnlen.x: New file to filter -Og from
|
||||
options to test.
|
||||
|
||||
2018-12-07 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/88349
|
||||
|
|
14
gcc/testsuite/gcc.c-torture/execute/builtins/strnlen.x
Normal file
14
gcc/testsuite/gcc.c-torture/execute/builtins/strnlen.x
Normal file
|
@ -0,0 +1,14 @@
|
|||
# At -Og no pass records the global range information
|
||||
# necessary to optimize the strnlen calls down to
|
||||
# a constant. The framework assumes that the test
|
||||
# will never call strnlen when the optimizer is
|
||||
# enabled. So we filter out the -Og run here.
|
||||
|
||||
set torture_eval_before_compile {
|
||||
if {[string match {*-Og*} "$option"]} {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return 0
|
||||
|
|
@ -578,6 +578,7 @@ public:
|
|||
: dom_walker (direction, REACHABLE_BLOCKS),
|
||||
m_const_and_copies (const_and_copies),
|
||||
m_avail_exprs_stack (avail_exprs_stack),
|
||||
evrp_range_analyzer (true),
|
||||
m_dummy_cond (dummy_cond) { }
|
||||
|
||||
virtual edge before_dom_children (basic_block);
|
||||
|
|
Loading…
Add table
Reference in a new issue