On 4/19/23 12:03, Ajit Agarwal wrote:
Hello All:
This is patch-4 to improve ree pass for rs6000 target.
Use ABI interfaces support.
Bootstrapped and regtested on powerpc64-linux-gnu.
Thanks & Regards
Ajit
ree: Improve ree pass for rs6000 target.
For rs6000 target we see redundant zero and sign
extension and done to improve ree pass to eliminate
such redundant zero and sign extension. Support of
ABI interfaces.
2023-04-19 Ajit Kumar Agarwal <aagar...@linux.ibm.com>
gcc/ChangeLog:
* ree.cc (combline_reaching_defs): Add zero_extend and sign_extend.
Add FUNCTION_ARG_REGNO_P abi interfaces calls and
FUNCTION_VALUE_REGNO_P support.
(add_removable_extension): Add FUNCTION_ARG_REGNO_P abi
interface calls.
gcc/testsuite/ChangeLog:
* g++.target/powerpc/zext-elim-3.C
So my general comment on this code is we need to expose properties of
the ABI so they can be queried. ie, just because you found that a REGNO
happens to be a function argument doesn't mean you know anything about
its extension status. We need a way to describe the extension property
of the ABI. Ideally there'll be something pre-existing that we can
query, but I'm not sure that's the case.
The overarching point is what you're doing is highly dependent on the
precise semantics of the ABI. But nowhere do you ask the question "does
the ABI mandate a particular sign/zero extension state for this
argument?" So it's just wrong as-written as far as I can tell.
Jeff