On 8/24/23 23:16, Vineet Gupta wrote:
Hoist want_to_gcse_p () calls rtx_cost () to compute max distance for hoist candidates. For a simple const (say 6 which needs seperate insn "LI 6") backend currently returns 0, causing Hoist to bail and elide GCSE. Note that constants requiring more than 1 insns to setup were working fine since riscv_rtx_costs () was returning non-zero (although that itself might need refining: see bugzilla 111139). To keep testsuite parity, some V tests need updating which started failing in the new costing regime. gcc/ChangeLog: * gcc/config/riscv.cc (riscv_rtx_costs): Adjust const_int cost. Add some comments about different constants handling. gcc/testsuite/ChangeLog: * gcc.target/riscv/gcse-const.c: New Test * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-7.c: Remove test for Jump. * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-8.c: Ditto.
OK. jeff