On Wed Oct 14, 2026 at 4:33 PM CEST, Martin Jambor wrote:
> Hi,
>
> On Mon, Sep 21 2026, Josef Melcr wrote:
>> Currently, assume bodies are created with attributes preventing IPA
>> optimizations, even if the function from which they were outlined don't
>> have them.  In order to make IPA for assume bodies possible, this patch
>> changes said behavior to make assumes inherit attributes from the
>> function from which they were outlined.  This means that the assume body
>> will have the IPA-preventing attribute only if the function which
>> spawned it has it.
>>
>> gcc/ChangeLog:
>>
>>      * gimple-low.cc (create_assumption_fn): Don't add attributes
>>      disabling optimizations.
>
> Have you bootstrapped and tested this patch independently?  If so, this
> is OK.

I only bootstrapped the patch on top of all the other previous patches
(bootstrapped the previous patches, applied this patch and ran make).  I
only tested the entire series all together.  This is one of the few
patches I would be reluctant to commit this on its own and probably wait
for the rest of the series to pass review.

>
> Martin

Josef

>
>
>>
>> Signed-off-by: Josef Melcr <[email protected]>
>> ---
>>  gcc/gimple-low.cc | 13 +------------
>>  1 file changed, 1 insertion(+), 12 deletions(-)
>>
>> diff --git a/gcc/gimple-low.cc b/gcc/gimple-low.cc
>> index 8d9ffd24124..6f0f5bedd02 100644
>> --- a/gcc/gimple-low.cc
>> +++ b/gcc/gimple-low.cc
>> @@ -302,18 +302,7 @@ create_assumption_fn (location_t loc)
>>    DECL_EXTERNAL (decl) = 0;
>>    DECL_CONTEXT (decl) = NULL_TREE;
>>    DECL_INITIAL (decl) = make_node (BLOCK);
>> -  tree attributes = DECL_ATTRIBUTES (current_function_decl);
>> -  if (lookup_attribute ("noipa", attributes) == NULL)
>> -    {
>> -      attributes = tree_cons (get_identifier ("noipa"), NULL, attributes);
>> -      if (lookup_attribute ("noinline", attributes) == NULL)
>> -    attributes = tree_cons (get_identifier ("noinline"), NULL, attributes);
>> -      if (lookup_attribute ("noclone", attributes) == NULL)
>> -    attributes = tree_cons (get_identifier ("noclone"), NULL, attributes);
>> -      if (lookup_attribute ("no_icf", attributes) == NULL)
>> -    attributes = tree_cons (get_identifier ("no_icf"), NULL, attributes);
>> -    }
>> -  DECL_ATTRIBUTES (decl) = attributes;
>> +  DECL_ATTRIBUTES (decl) = DECL_ATTRIBUTES (current_function_decl);
>>    BLOCK_SUPERCONTEXT (DECL_INITIAL (decl)) = decl;
>>    DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
>>      = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (current_function_decl);
>> -- 
>> 2.55.0


Reply via email to