internal-fn: Support undefined rtx for uninitialized SSA_NAME[PR110751]
commit27282dc0931484c31fa391772499d878afcc746a
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Wed, 20 Sep 2023 14:58:49 +0000 (20 22:58 +0800)
committerRobin Dapp <rdapp@ventanamicro.com>
Wed, 20 Sep 2023 16:27:08 +0000 (20 18:27 +0200)
tree00f8ac0e91c22bb4c105172dc283def4104ef363
parent75c4b0cde4835b45350da0a5cd82f1d1a0a7a2f1
internal-fn: Support undefined rtx for uninitialized SSA_NAME[PR110751]

According to PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110751

As Richard and Richi suggested, we recognize uninitialized SSA_NAME and convert it
into SCRATCH rtx if the target predicate allows SCRATCH.

It can help to reduce redundant data move instructions of targets like RISC-V.

Bootstrap and Regression on x86 passed.

gcc/ChangeLog:
PR target/110751

* internal-fn.cc (expand_fn_using_insn): Support undefined rtx value.
* optabs.cc (maybe_legitimize_operand): Ditto.
(can_reuse_operands_p): Ditto.
* optabs.h (enum expand_operand_type): Ditto.
(create_undefined_input_operand): Ditto.
gcc/internal-fn.cc
gcc/optabs.cc
gcc/optabs.h