llvm / llvm/llvm-project

RISCV fold of vscale add on rvv is not optimal

Open
#222,933 5 comments 0 reactions 1 assignee Claimed by @FoolgryGamer View on GitHub
backend:RISC-V good first issue missed-optimization
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The fold

(A + vscale(C1)) + vscale(C2) -> A + vscale(C1 + C2)

does not seem to beneficial for riscv when inner add has multiple uses, as it would introduce extra add.

unnecesary add can be optimized from here: https://godbolt.org/z/9xfWc5voc

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.