https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118125

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
On top if r15-7055-g459816efa13d9d I added a patch adding a
dbg_counter to limit the updates.

The slow-down is caused by two updates of value ranges in jump
function, both of which are necessary to get the slow-down:

+***dbgcnt: lower limit 2175 reached for ipa_update_vr.***
+***dbgcnt: upper limit 2175 reached for ipa_update_vr.***
+ipa-prop: Updating jump function VR of _M_create_storage/62058 ->
allocate.constprop/58360 1 based on info from __ct_base /216 ->
_M_create_storage/62058 1 (which is being inlined).
+  After intersecting: [irange] size_type [1, +INF] and [irange] size_type [0,
1152921504606846975] MASK 0xfffffffffffffff VALUE 0x0, setting it to: [irange]
size_type [1, 1152921504606846975]

and later

+***dbgcnt: lower limit 2175 reached for ipa_update_vr.***
+***dbgcnt: upper limit 2175 reached for ipa_update_vr.***
+ipa-prop: Updating jump function VR of _M_create_storage/62058 ->
allocate.constprop/58360 1 based on info from __ct_base /216 ->
_M_create_storage/62058 1 (which is being inlined).
+  After intersecting: [irange] size_type [1, +INF] and [irange] size_type [0,
1152921504606846975] MASK 0xfffffffffffffff VALUE 0x0, setting it to: [irange]
size_type [1, 1152921504606846975]
+

Apart from slight inlining ordering differences, this leads to the
following differences in inlining results for hottest function that
has slowed down (excluding differences only in symtab_node UIDs):

----------------------------------------------------------------------

--- sum-fast    2025-01-22 14:34:31.711998384 +0100
+++ sum-slow    2025-01-22 14:35:05.579500645 +0100
@@ -1,12 +1,12 @@
 IPA function summary for solve/39387 inlinable fp_expression
-  global time:     584936.726562
+  global time:     584902.237305
   self size:       55
-  global size:     1305
-  min size:       1296
+  global size:     1301
+  min size:       1292
   self stack:      648
   global stack:    1194
   estimated growth:329
-    size:891.500000, time:571399.283203
+    size:889.500000, time:571399.283203
     size:3.000000, time:2.000000,  executed if:(not inlined)
     size:0.500000, time:0.500000,  executed if:(op1 not sra candidate) && (not
inlined),  nonconst if:(op1 not sra candidate) && (op1[ref offset: 576]
changed) && (not inlined)
     size:0.500000, time:0.500000,  executed if:(op1 not sra candidate), 
nonconst if:(op1 not sra candidate) && (op1[ref offset: 576] changed)
@@ -298,18 +298,18 @@
         __ct_base /66382 inlined
           freq:17.25 cross module
           Stack frame offset 1194, callee self size 0
-        reinit.constprop/66851 inlined
+        reinit.constprop/66419 inlined
           freq:17.25
           Stack frame offset 1194, callee self size 0
           operator new []/151 function body not available
             freq:5.69 loop depth: 2 size: 3 time: 12
           operator delete []/146 function body not available
             freq:3.04 loop depth: 2 size: 2 time: 11
-          _ZN6dealii6VectorIdE6reinitEjb.part.0/66852 inlined
+          _ZN6dealii6VectorIdE6reinitEjb.part.0/66420 inlined
             freq:5.86
             Stack frame offset 1194, callee self size 0
-            operator delete []/146 function body not available
-              freq:3.14 loop depth: 2 size: 2 time: 11
+            __builtin_unreachable/57309 unreachable
+              freq:0.00 cross module loop depth: 2 size: 0 time:  0 predicate:
(false)
         __dt_base /7005 call is unlikely and code size would grow
           freq:0.00 cross module loop depth: 2 size: 2 time: 11 callee size: 7
stack: 0
            op0 is compile time invariant

----------------------------------------------------------------------

I.e. one call of operator delete[](void*) from function
dealii::Vector<double>::reinit(unsigned int, bool) is determined to
never be executed.

Reply via email to