]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use can_open_code_p in gimple-ssa-store-merging master trunk
authorRichard Sandiford <rdsandiford@googlemail.com>
Sat, 6 Jun 2026 08:16:13 +0000 (09:16 +0100)
committerRichard Sandiford <rdsandiford@googlemail.com>
Sat, 6 Jun 2026 08:16:13 +0000 (09:16 +0100)
commitcc58cf0d2f9b255e29d9b7a409c5ab31542604d1
treed483555327ad99ae09cd17d15553f3961777b5ab
parent793da440da5c84090af9e864b824157db02cdc82
Use can_open_code_p in gimple-ssa-store-merging

...and extend can_open_code_p to handle bswap.

I'm not sure that the removed builtin_decl_explicit_p (BUILT_IN_BSWAP32)
calls are necessary, since the code would go on to use a BSWAP64
rather than a BSWAP32.

This fixes gcc.dg/optimize-bswapsi-6.c on RISC-V.

gcc/
* optabs-query.cc (can_open_code_p): Handle more bswap cases,
incorporating logic from...
* gimple-ssa-store-merging.cc (maybe_optimize_vector_constructor)
(pass_optimize_bswap::execute)
(imm_store_chain_info::try_coalesce_bswap): ...here.  Use
can_open_code_p instead of direct optab_handler checks.
gcc/gimple-ssa-store-merging.cc
gcc/optabs-query.cc