diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-09-13 18:06:57 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-09-13 20:43:36 +0200 |
commit | 4ffca9966a9c43cedafe56d3ef8033182290f25b (patch) | |
tree | 117d5c3da3136492e909c414dbe50bf4dfd4db9f /gcc | |
parent | 8ed8c342fba682286159f56d0e53a05db95762a0 (diff) | |
download | gcc-4ffca9966a9c43cedafe56d3ef8033182290f25b.zip gcc-4ffca9966a9c43cedafe56d3ef8033182290f25b.tar.gz gcc-4ffca9966a9c43cedafe56d3ef8033182290f25b.tar.bz2 |
AVR: Detect more skip opportunities.
The transparent call insns like "*parityhi2.libgcc" output a single
[R]CALL instruction that can be skipped by the skip instructions.
Such insns have attribute "type" of "xcall" and can therefore
be easily recognized. Same applies when "adjust_len" is "call".
gcc/
* config/avr/avr.cc (avr_2word_insn_p): Return true for
transparent calls: When insn attribute "type" is "xcall"
or when "adjust_len" is "call".
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/avr/avr.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 48d1d0e..4cb51ea 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -12972,7 +12972,7 @@ test_hard_reg_class (enum reg_class rclass, rtx x) } -/* Helper for jump_over_one_insn_p: Test if INSN is a 2-word instruction +/* Helper for `jump_over_one_insn_p': Test if INSN is a 2-word instruction and thus is suitable to be skipped by CPSE, SBRC, etc. */ static bool @@ -12986,7 +12986,10 @@ avr_2word_insn_p (rtx_insn *insn) switch (INSN_CODE (insn)) { default: - return false; + return (recog_memoized (insn) >= 0 + // Transparent calls may be skipped. + && (get_attr_type (insn) == TYPE_XCALL + || get_attr_adjust_len (insn) == ADJUST_LEN_CALL)); case CODE_FOR_movqi_insn: case CODE_FOR_movuqq_insn: |