[PATCH] D63303: [GlobalISel][Localizer] Rewrite localizer to run in 2 phases, inter & intra block.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 15:46:52 PDT 2019


aemerson created this revision.
aemerson added reviewers: qcolombet, paquette, arsenm, rovka, Petar.Avramovic.
Herald added subscribers: volkan, hiraditya, kristof.beyls, javed.absar, wdng.
Herald added a project: LLVM.

Inter-block location is the same as what currently happens, except now it only runs on the entry block because that's where the problematic constants with long live ranges come from.

The second phase is a new intra-block localization phase which attempts to re-sink the already localized instructions further right before one of the multiple uses.

One additional change is to also localize G_GLOBAL_VALUE as they're constants too, unless it has more than 2 users.

Overall, these changes improve CTMark code size on arm64 by 1.2%.

Full code size results:

  Program                                         baseline       new       diff
  ------------------------------------------------------------------------------
   test-suite...-typeset/consumer-typeset.test    1249984      1217216     -2.6%
   test-suite...:: CTMark/ClamAV/clamscan.test    1264928      1232152     -2.6%
   test-suite :: CTMark/SPASS/SPASS.test          1394092      1361316     -2.4%
   test-suite...Mark/mafft/pairlocalalign.test    731320       714928      -2.2%
   test-suite :: CTMark/lencod/lencod.test        1340592      1324200     -1.2%
   test-suite :: CTMark/kimwitu++/kc.test         3853512      3820420     -0.9%
   test-suite :: CTMark/Bullet/bullet.test        3406036      3389652     -0.5%
   test-suite...ark/tramp3d-v4/tramp3d-v4.test    8017000      8016992     -0.0%
   test-suite...TMark/7zip/7zip-benchmark.test    2856588      2856588      0.0%
   test-suite...:: CTMark/sqlite3/sqlite3.test    765704       765704       0.0%
   Geomean difference                                                      -1.2%


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63303

Files:
  llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
  llvm/lib/CodeGen/GlobalISel/Localizer.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/localizer.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63303.204645.patch
Type: text/x-patch
Size: 13269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/29960b81/attachment.bin>


More information about the llvm-commits mailing list