On 12/8/22 10:53, Palmer Dabbelt wrote:
On Wed, 07 Dec 2022 12:55:17 PST (-0800), rzin...@ventanamicro.com wrote:
Due to RISC-V limitations on operations with big constants combine
is failing to match such operations and is not being able to
produce optimal code as it keeps splitting them. By pretending we
can do those operations we can get more opportunities for
simplification of surrounding instructions.

I saw Jeff's comments.  This is always the kind of thing that worries me: we're essentially lying to the optimizer in order to trick it into generating better code, which might just make it generate worse code. It's always easy to see a small example that improves, but those could be wiped out by secondary effects in real code.  So I'd usually want to have some benchmarking for a patch like this.

That said, if this is just the standard way of doing things then maybe it's just fine?
Bridge combiner patterns are pretty standard. The insn's condition of cse_not_expected is also in there to minimize the potential for surprises by not exposing this too early.

jeff

Reply via email to