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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linkw at gcc dot gnu.org
             Status|ASSIGNED                    |NEW
           Assignee|marxin at gcc dot gnu.org          |unassigned at gcc dot 
gnu.org

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
So what happens in LTO mode: rs6000_can_inline_p is called with:

#0  rs6000_can_inline_p (caller=<function_decl 0x7ffff7427800 gemmMMA>,
callee=<function_decl 0x7ffff7433400 bmask>) at
/home/marxin/Programming/gcc/gcc/config/rs6000/rs6000.c:25035
#1  0x0000000002529129 in can_inline_edge_p (e=<cgraph_edge* 0x7ffff744d548
(<cgraph_node * 0x7ffff75bbaa0 "gemmMMA"/9> -> <cgraph_node * 0x7ffff75bbcc0
"bmask"/11>)>, report=true, early=true) at
/home/marxin/Programming/gcc/gcc/ipa-inline.c:381
#2  0x000000000252a48a in can_early_inline_edge_p (e=<cgraph_edge*
0x7ffff744d548 (<cgraph_node * 0x7ffff75bbaa0 "gemmMMA"/9> -> <cgraph_node *
0x7ffff75bbcc0 "bmask"/11>)>) at
/home/marxin/Programming/gcc/gcc/ipa-inline.c:646
#3  0x000000000253135a in inline_always_inline_functions (node=<cgraph_node *
0x7ffff75bbaa0 "gemmMMA"/9>) at
/home/marxin/Programming/gcc/gcc/ipa-inline.c:2838

The following condition is false:

      /* The callee's options must be a subset of the caller's options, i.e.
         a vsx function may inline an altivec function, but a no-vsx function
         must not inline a vsx function.  However, for those options that the
         callee has explicitly enabled or disabled, then we must enforce that
         the callee's and caller's options match exactly; see PR70010.  */


>25062             if (((caller_isa & callee_isa) == callee_isa)

because:

(gdb) p /x (caller_isa & callee_isa) ^ callee_isa
$3 = 0x2000020000

which are the following masks:

#define OPTION_MASK_HTM (HOST_WIDE_INT_1U << 17)
#define OPTION_MASK_P8_FUSION (HOST_WIDE_INT_1U << 37)

So looking at the condition, callers options are not subset.

Which is caused by g:82800987cb3b22427a8799b3e8491eff496724b9

commit 82800987cb3b22427a8799b3e8491eff496724b9
Author: Kewen Lin <li...@linux.ibm.com>
Date:   Wed Dec 2 01:55:34 2020 -0600

    rs6000: Disable HTM for Power10 and later by default

    Power ISA 3.1 has dropped transactional memory support, this patch
    is to disable HTM feature for power10 and later by default.

    Bootstrapped/regtested on powerpc64le-linux-gnu P8 and P10.

    gcc/ChangeLog:

            * config/rs6000/rs6000.c (rs6000_option_override_internal):
            Use OPTION_MASK_DIRECT_MOVE for Power8 target_enable instead
            of OPTION_MASK_HTM.
            * config/rs6000/rs6000-cpus.def (ISA_2_7_MASKS_SERVER):
            Remove OPTION_MASK_HTM.
            (RS6000_CPU): Add OPTION_MASK_HTM to power8, power9 and
            powerpc64le entries.

@Kewen: Can you please take a look?

Reply via email to