[PATCH] D136793: [AArch64][GlobalISel] Add some minor post-selection optimizations.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 14:43:14 PDT 2022


aemerson created this revision.
aemerson added a reviewer: paquette.
aemerson added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
Herald added a project: All.
aemerson requested review of this revision.

The first is doing some trivial cross-regclass folding, where we can either
do some extra constraining to eliminate the copy or modify uses to use a smaller
regclass.

The second is that we set the kill flags on vreg use operands if they're the
only use of that vreg.

Both of these cases seem to be done by SelectionDAG's lowering from DAG to
MIs that we currently miss. There are minor code size improvements on average.

Here's the results for -Os on CTMark.

  Program                                       size.__text
                                                before         after           diff
  tramp3d-v4/tramp3d-v4                         366000.00      366012.00       0.0%
  mafft/pairlocalalign                          248196.00      248188.00      -0.0%
  7zip/7zip-benchmark                           568612.00      568592.00      -0.0%
  kimwitu++/kc                                  434704.00      434676.00      -0.0%
  Bullet/bullet                                 456128.00      456096.00      -0.0%
  sqlite3/sqlite3                               284136.00      284100.00      -0.0%
  ClamAV/clamscan                               381492.00      381396.00      -0.0%
  SPASS/SPASS                                   412052.00      411944.00      -0.0%
  lencod/lencod                                 428060.00      427912.00      -0.0%
  consumer-typeset/consumer-typeset             413148.00      411116.00      -0.5%
                             Geomean difference                               -0.1%


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136793

Files:
  llvm/lib/Target/AArch64/GISel/AArch64PostSelectOptimize.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/postselectopt-constrain-new-regop.mir
  llvm/test/CodeGen/AArch64/GlobalISel/postselectopt-dead-cc-defs-in-fcmp.mir
  llvm/test/CodeGen/AArch64/GlobalISel/postselectopt-killflags.mir
  llvm/test/CodeGen/AArch64/GlobalISel/postselectopt-xclass-copies.mir
  llvm/test/CodeGen/AArch64/kcfi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136793.470940.patch
Type: text/x-patch
Size: 25081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221026/5c10d8b2/attachment.bin>


More information about the llvm-commits mailing list