]> git.ipfire.org Git - thirdparty/gcc.git/commit
Keep VR_UNDEFINED and VR_VARYING in sync (speeds up evrp by 8.47%).
authorAldy Hernandez <aldyh@redhat.com>
Fri, 16 Apr 2021 16:40:44 +0000 (18:40 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 26 Apr 2021 16:20:38 +0000 (18:20 +0200)
commitdc80d5e887ea4fa0e1e950db5f6bdd765c960c22
tree5745ec11b2ec0767dd0b33991dd425012b541d45
parent694c956b6b877e48323cf86c90c09237b7b0e8c8
Keep VR_UNDEFINED and VR_VARYING in sync (speeds up evrp by 8.47%).

Currently multi-ranges calculate the undefined and varying bits on the
fly, whereas legacy uses the m_kind field.  Since we will always have
space in the irange class for a kind field, might as well keep it in
sync as ranges are created, thus speeding up lookups.

This patch, along with an upcoming ones for num_pairs(), speeds up EVRP
by 8.47%, VRP proper by 1.84% and overall compilation by 0.24%.

FWIW, since evrp is such a fast pass, and is hard to measure clock-wise,
we've been using callgrind to estimate improvements.  This has coincided
more or less with -ftime-report numbers (albeit having to run -ftime-report
half a dozen times and use the average).

gcc/ChangeLog:

* value-range.cc (irange::operator=): Set m_kind.
(irange::copy_to_legacy): Handle varying and undefined sources
as a legacy copy since they can be easily copied.
(irange::irange_set): Set m_kind.
(irange::irange_set_anti_range): Same.
(irange::set): Rename normalize_min_max to normalize_kind.
(irange::verify_range): Adjust for multi-ranges having the
m_kind field set.
(irange::irange_union): Set m_kind.
(irange::irange_intersect): Same.
(irange::invert): Same.
* value-range.h (irange::kind): Always return m_kind.
(irange::varying_p): Rename to...
(irange::varying_comptaible_p): ...this.
(irange::undefined_p): Only look at m_kind.
(irange::irange): Always set VR_UNDEFINED if applicable.
(irange::set_undefined): Always set VR_UNDEFINED.
(irange::set_varying): Always set m_kind to VR_VARYING.
(irange::normalize_min_max): Rename to...
(irange::normalize_kind): ...this.
gcc/value-range.cc
gcc/value-range.h