[PATCH] D139135: [RISCV] Teach RISCVMatInt to prefer li+slli over lui+addi(w) for compressibility.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 12:08:31 PST 2022
craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, reames, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.
With C extension, li with a 6 bit immediate followed by slli is 4 bytes.
The lui+addi(w) sequence is at least 6 bytes.
The two sequences probably have similar execution latency. The exception
being if the target supports lui+addi(w) macrofusion.
Since the execution latency is probably the same I didn't restrict
this to C extension.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139135
Files:
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
llvm/test/CodeGen/RISCV/calling-conv-half.ll
llvm/test/CodeGen/RISCV/i32-icmp.ll
llvm/test/CodeGen/RISCV/i64-icmp.ll
llvm/test/CodeGen/RISCV/macro-fusion-lui-addi.ll
llvm/test/CodeGen/RISCV/mul.ll
llvm/test/CodeGen/RISCV/pr58511.ll
llvm/test/CodeGen/RISCV/rv32zbs.ll
llvm/test/CodeGen/RISCV/rv64zbs.ll
llvm/test/CodeGen/RISCV/rvv/active_lane_mask.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-buildvec.ll
llvm/test/CodeGen/RISCV/rvv/large-rvv-stack-size.mir
llvm/test/CodeGen/RISCV/rvv/vscale-power-of-two.ll
llvm/test/MC/RISCV/rv32c-aliases-valid.s
llvm/test/MC/RISCV/rv32i-aliases-valid.s
llvm/test/MC/RISCV/rv64c-aliases-valid.s
llvm/test/MC/RISCV/rv64i-aliases-valid.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139135.479381.patch
Type: text/x-patch
Size: 22069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221201/c2d889c3/attachment.bin>
More information about the llvm-commits
mailing list