diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-11-06 00:14:43 -0600 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-11-06 00:14:43 -0600 |
commit | b2075291af8810794c7184fd125b991c2341cb1e (patch) | |
tree | 85847b39cde16f7aec63777c63c4c7ec4b810f0a /gcc/function.cc | |
parent | 1a55724f7870719d51a7acc0ccada254fcfd1cda (diff) | |
download | gcc-b2075291af8810794c7184fd125b991c2341cb1e.zip gcc-b2075291af8810794c7184fd125b991c2341cb1e.tar.gz gcc-b2075291af8810794c7184fd125b991c2341cb1e.tar.bz2 |
rs6000: Consider inline asm as safe if no assembler complains [PR111828]
As discussed in PR111828, rs6000_update_ipa_fn_target_info
is much conservative, currently for any non-empty inline
asm, without any parsing, it would take inline asm could
have HTM insns. It means for one function attributed with
power8 having inline asm, even if it has no HTM insns, we
don't make a function attributed with power10 inline it.
Peter pointed out an inline asm parser can be a slippery
slope, and noticed that the current gnu assembler still
allows HTM insns even with power10 machine type, so he
suggested that we can aggressively ignore the handling on
inline asm, this patch goes for this suggestion.
Considering that there are a few assembler alternatives
and assembler can update its behaviors (complaining HTM
insns at power10 and later cpus sounds reasonable from a
certain point of view), this patch also checks assembler
complains on HTM insns at power10 or not. For a case that
a caller attributed power10 calls a callee attributed
power8 having inline asm with HTM insn, without inlining
at least the compilation succeeds, but if assembler
complains HTM insns at power10, after inlining the
compilation would fail.
The two associated test cases are fine without and with
this patch (effective target takes effect or not).
PR target/111828
gcc/ChangeLog:
* config.in: Regenerate.
* config/rs6000/rs6000.cc (rs6000_update_ipa_fn_target_info): Guard
inline asm handling under !HAVE_AS_POWER10_HTM.
* configure: Regenerate.
* configure.ac: Detect assembler support for HTM insns at power10.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp
(check_effective_target_powerpc_as_p10_htm): New proc.
* g++.target/powerpc/pr111828-1.C: New test.
* g++.target/powerpc/pr111828-2.C: New test.
Diffstat (limited to 'gcc/function.cc')
0 files changed, 0 insertions, 0 deletions