diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:21:19 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:21:19 +0000 |
commit | 0ce77f463d1d150e70a91807502d628492ca7ae5 (patch) | |
tree | fff69a7a5884e5343e2f31969d911df27599af70 /gcc/regrename.h | |
parent | 30503f4ea491b9d6b9da00889155ecaa5d15cfb9 (diff) | |
download | gcc-0ce77f463d1d150e70a91807502d628492ca7ae5.zip gcc-0ce77f463d1d150e70a91807502d628492ca7ae5.tar.gz gcc-0ce77f463d1d150e70a91807502d628492ca7ae5.tar.bz2 |
Remove global call sets: regrename.c
This patch makes regrename use a similar mask-and-clobber-set
pair to IRA when tracking whether registers are clobbered by
calls in a region. Testing for a nonzero ABI mask is equivalent
to testing for a register that crosses a call.
Since AArch64 and c6x use regrename.h, they need to be updated
to include function-abi.h first. AIUI this is preferred over
including function-abi.h in regrename.h.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* regrename.h (du_head::call_clobber_mask): New field.
(du_head::need_caller_save_reg): Replace with...
(du_head::call_abis): ...this new field.
* regrename.c: Include function-abi.h.
(call_clobbered_in_chain_p): New function.
(check_new_reg_p): Use crtl->abi when deciding whether a register
is free for use after RA. Use call_clobbered_in_chain_p to test
whether a candidate register would be clobbered by a call.
(find_rename_reg): Don't add call-clobber conflicts here.
(rename_chains): Check call_abis instead of need_caller_save_reg.
(merge_chains): Update for changes to du_head.
(build_def_use): Use insn_callee_abi to get the ABI of the call insn
target. Record the ABI identifier in call_abis and the set of
fully or partially clobbered registers in call_clobber_mask.
Add fully-clobbered registers to hard_conflicts here rather
than in find_rename_reg.
* config/aarch64/cortex-a57-fma-steering.c: Include function-abi.h.
(rename_single_chain): Check call_abis instead of need_caller_save_reg.
* config/aarch64/falkor-tag-collision-avoidance.c: Include
function-abi.h.
* config/c6x/c6x.c: Likewise.
From-SVN: r276332
Diffstat (limited to 'gcc/regrename.h')
-rw-r--r-- | gcc/regrename.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/regrename.h b/gcc/regrename.h index 2fe12d5..a678963 100644 --- a/gcc/regrename.h +++ b/gcc/regrename.h @@ -41,9 +41,12 @@ public: bitmap_head conflicts; /* Conflicts with untracked hard registers. */ HARD_REG_SET hard_conflicts; + /* Which registers are fully or partially clobbered by the calls that + the chain crosses. */ + HARD_REG_SET call_clobber_mask; - /* Nonzero if the chain crosses a call. */ - unsigned int need_caller_save_reg:1; + /* A bitmask of ABIs used by the calls that the chain crosses. */ + unsigned int call_abis : NUM_ABI_IDS; /* Nonzero if the register is used in a way that prevents renaming, such as the SET_DEST of a CALL_INSN or an asm operand that used to be a hard register. */ |