Optimize (add (shl x, c0), (shl y, c1)) ->
(SLLI (SH*ADD x, y), c1), if c0-c1 == 1/2/3.
Paths
| Differential D108916
[RISCV] Optimize (add (shl x, c0), (shl y, c1)) with SH*ADD ClosedPublic Authored by benshi001 on Aug 30 2021, 6:23 AM.
Details Summary Optimize (add (shl x, c0), (shl y, c1)) -> (SLLI (SH*ADD x, y), c1), if c0-c1 == 1/2/3.
Diff Detail
Unit TestsFailed
Event TimelineHerald added subscribers: vkmr, frasercrmck, evandro and 22 others. · View Herald TranscriptAug 30 2021, 6:23 AM benshi001 added a parent revision: D108915: [RISCV][test] Add new tests for optimization with SH*ADD in the zba extension.
benshi001 marked 2 inline comments as done. Comment Actions ping... Can this patch be revriewed and accepted? It is safe and does improve code quality. This revision is now accepted and ready to land.Sep 16 2021, 4:06 AM This revision now requires changes to proceed.Sep 16 2021, 5:15 AM benshi001 marked 3 inline comments as done. Comment Actions
The reason I created https://reviews.llvm.org/D109729 is that current patch has been pending for weeks and I thought you disagree with it. So I created https://reviews.llvm.org/D109729, which initial version was the same optimization but implemented in TD rules. However TD rules were in bad form so I changed it to DAG2GAG. However I think both patches are OK. If current one can be accepted, then I will close https://reviews.llvm.org/D109729. Comment Actions The build failure x64 debian > libomp.api::omp_get_wtime.c seems not related to my patch.
benshi001 marked 2 inline comments as done. Comment ActionsAlso I have moved transformAddShlImm into performADDCombine benshi001 marked an inline comment as done.
benshi001 marked 2 inline comments as done. This revision was landed with ongoing or failed builds. Closed by commit rGdee5a8ca325f: [RISCV] Optimize (add (shl x, c0), (shl y, c1)) with SH*ADD (authored by benshi001). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 369437 llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rv32zba.ll
llvm/test/CodeGen/RISCV/rv64zba.ll
|
Nit: vector