[GlobalISel][Localizer] Enable intra-block localization of already-local uses.
authorAmara Emerson <aemerson@apple.com>
Tue, 3 Mar 2020 19:36:47 +0000 (11:36 -0800)
committerAmara Emerson <aemerson@apple.com>
Wed, 4 Mar 2020 02:14:57 +0000 (18:14 -0800)
commite91e1df6ab74006e96b0cca94192e935542705a4
tree9f543245a2cf2d28590c8dcfeb0dc0222f51bd76
parent7af4374ff81120f6efa3c851b9c3063d76291195
[GlobalISel][Localizer] Enable intra-block localization of already-local uses.

This changes the localizer to attempt intra-block localizer of instructions
that have local uses. This is useful because sometimes the entry block itself
has many uses of constant-like instructions, which would benefit from shortening
live ranges. Previously if an inst had no non-local uses, we wouldn't add it to
the list of instructions to attempt further intra-block localization.

This gives a 0.7% geomean code size improvement on CTMark.

Differential Revision: https://reviews.llvm.org/D75555
12 files changed:
llvm/lib/CodeGen/GlobalISel/Localizer.cpp
llvm/test/CodeGen/AArch64/GlobalISel/localizer-arm64-tti.ll
llvm/test/CodeGen/AArch64/GlobalISel/localizer.mir
llvm/test/CodeGen/AArch64/GlobalISel/swifterror.ll
llvm/test/CodeGen/AArch64/GlobalISel/translate-constant-dag.ll
llvm/test/CodeGen/AArch64/tail-call.ll
llvm/test/CodeGen/AArch64/tiny_model.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/constant-bus-restriction.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/mubuf-global.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.ll