[Bug target/111466] RISC-V: redundant sign extensions despite ABI guarantees
vineetg at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 28 21:23:54 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111466
--- Comment #2 from Vineet Gupta <vineetg at gcc dot gnu.org> ---
(In reply to Vineet Gupta from comment #1)
> #1. REE reports failure as "missing definition(s)".
>
> This is because function args don't have an explicit def, they are just
> there.
>
> Cannot eliminate extension:
> (insn 12 6 13 2 (set (reg:DI 16 a6 [orig:138 n.1_15 ] [138])
> (sign_extend:DI (reg:SI 11 a1 [orig:141 n ] [141]))) {extendsidi2}
> (nil))
> because of missing definition(s)
For addressing missing definition(s) there are a couple of approaches:
#1a. Try to use Ajit Agarwal's REE updates [1] which is supposed to uses
defined ABI interfaces and identify incoming args or return values.
- however even the latest v8 series doesn't properly address the review
comments - it hard codes the {ZERO,SIGN}_EXTEND in REE w/o actually querying
the ABI
- requires both src and dest hard regs be the same which is often not the
case.
- But we can certainly use some concepts from this patch.
#1b. To Jeff suggested [2][3] inserting dummy sign_extend in REE for the
function args, which could be eliminated by REE.
[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630935.html
[2] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630899.html
[3] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631543.html
More information about the Gcc-bugs
mailing list