aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2024-04-30 19:39:00 +0200
committerAldy Hernandez <aldyh@redhat.com>2024-05-01 09:37:05 +0200
commitc60b3e211c555706cdc2dc8bfcdd540152cff350 (patch)
tree12baf1a49ab7271194679a4e68936e5d65c78641 /gcc/objc
parent1b5732de7e3980aa5197b1ac818f48f1ce9f87ab (diff)
downloadgcc-c60b3e211c555706cdc2dc8bfcdd540152cff350.zip
gcc-c60b3e211c555706cdc2dc8bfcdd540152cff350.tar.gz
gcc-c60b3e211c555706cdc2dc8bfcdd540152cff350.tar.bz2
Reduce startup costs for Value_Range.
Value_Range is our polymorphic temporary that can hold any range. It is used for type agnostic code where it isn't known ahead of time, what the type of the range will be (irange, france, etc). Currently, there is a temporary of each type in the object, which means we need to construct each range for every temporary. This isn't scaling well now that prange is about to add yet another range type. This patch removes each range, opting to use in-place new for a byte buffer sufficiently large to hold ranges of any type. It reduces the memory footprint by 14% for every Value_Range temporary (from 792 to 680 bytes), and we are guaranteed it will never again grow as we add more range types (strings, complex numbers, etc). Surprisingly, it improves VRP performance by 6.61% and overall compilation by 0.44%, which is a lot more than we bargained for when we started working on prange performance. There is a slight change in semantics for Value_Range. The default constructor does not initialize the object at all. It must be manually initialized with either Value_Range::set_type(), or by assigning a range to it. This means that IPA's m_known_value_ranges must be initialized at allocation, instead of depending on the empty constructor to initialize it to VR_UNDEFINED for unsupported_range. I have taken the time to properly document both the class, and each method. If anything isn't clear, please let me know so I can adjust it accordingly. gcc/ChangeLog: * ipa-fnsummary.cc (evaluate_properties_for_edge): Initialize Value_Range's. * value-range.h (class Value_Range): Add a buffer and remove m_irange and m_frange. (Value_Range::Value_Range): Call init. (Value_Range::set_type): Same. (Value_Range::init): Use in place new to initialize buffer. (Value_Range::operator=): Tidy.
Diffstat (limited to 'gcc/objc')
0 files changed, 0 insertions, 0 deletions