On 8/3/23 16:26, Vineet Gupta wrote:
As discussed in Tue call, I definitely have 1 fix to riscv_rtx_costs (),
which is worth pondering. It adjusts the cost of consts and helps Hoist
GCSE constants (which granted kicks in only at -Os). However it does
affect codegen in subtle ways since CSE1 now for some cases generates
additional REG_EQUAL note.
Yea, we'll definitely want to take a look. It's not likely affecting my
work, but definitely want to evaluate as part of the overall costing
question.
On a different but slightly related note, I was playing with Zicond this
morning (enabling by default in toolchain build and qemu) and I was
surprised to see that glibc build currently doesn't have a single czero*
insn - although gcc has bene configured with
Probably costing ;-) That little hunk that snuck through is part of
how I arrange to get more czero instructions when running the GCC
testsuite.
Also note that if you're disassembling with binutils, I think it just
dumps it out as a .word or something similar.
Point being, I can help with riscv_rtx_costs and friends, if you have
something specific, but seems like you are in the thick of it and have
that handled so I'll stay out of the way and refrain from zicond
work/testing for the time being.
;-) Actually if you wanted to poke at zicond, the most interesting
unexplored area I've come across is the COND_EXPR handling in gimple.
When we expand a COND_EXPR into RTL the first approach we take is to try
mov<mode>cc in RTL.
Unfortunately we don't create COND_EXPRs all that often in gimple. Some
simple match.pd patterns would likely really help here.
The problem is RTL expansion when mov<mode>cc FAILs is usually poor at
best. So if we're going to add those match.pd patterns, we probably
need to beef up the RTL expansion code to do a better job when the
target doesn't have a mov<mode>cc RTL pattern.
Jeff