Hi, Gentle ping this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578552.html One related patch [1] is ready to commit, whose test cases rely on this patch if no changes are applied to them. [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579658.html BR, Kewen >>> on 2021/9/1 下午2:55, Kewen.Lin via Gcc-patches wrote: >>>> Hi! >>>> >>>> This patch is to fix the inconsistent behaviors for non-LTO mode >>>> and LTO mode. As Martin pointed out, currently the function >>>> rs6000_can_inline_p simply makes it inlinable if callee_tree is >>>> NULL, but it's wrong, we should use the command line options >>>> from target_option_default_node as default. It also replaces >>>> rs6000_isa_flags with the one from target_option_default_node >>>> when caller_tree is NULL as rs6000_isa_flags could probably >>>> change since initialization. >>>> >>>> It also extends the scope of the check for the case that callee >>>> has explicit set options, for test case pr102059-2.c inlining can >>>> happen unexpectedly before, it's fixed accordingly. >>>> >>>> As Richi/Mike pointed out, some tuning flags like MASK_P8_FUSION >>>> can be neglected for inlining, this patch also exludes them when >>>> the callee is attributed by always_inline. >>>> >>>> Bootstrapped and regtested on powerpc64le-linux-gnu Power9. >>>> >>>> BR, >>>> Kewen >>>> ----- >>>> gcc/ChangeLog: >>>> >>>> PR ipa/102059 >>>> * config/rs6000/rs6000.c (rs6000_can_inline_p): Adjust with >>>> target_option_default_node and consider always_inline_safe flags. >>>> >>>> gcc/testsuite/ChangeLog: >>>> >>>> PR ipa/102059 >>>> * gcc.target/powerpc/pr102059-1.c: New test. >>>> * gcc.target/powerpc/pr102059-2.c: New test. >>>> * gcc.target/powerpc/pr102059-3.c: New test. >>>> * gcc.target/powerpc/pr102059-4.c: New test. >>>> >>>