[PATCH] D139135: [RISCV] Teach RISCVMatInt to prefer li+slli over lui+addi(w) for compressibility.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 12:51:04 PST 2022


reames added inline comments.


================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp:195
+      // Keep the new sequence if it is an improvement.
+      if (TmpSeq.size() < Res.size() || IsShiftedCompressible) {
+        Res = TmpSeq;
----------------
I think we could phrase this comparison in terms of getInstSeqCost, and abstract away the details of the compression cost here.  It would use a different default for when compression isn't enabled, but not sure we care about that point?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139135/new/

https://reviews.llvm.org/D139135



More information about the llvm-commits mailing list