[AArch64][GlobalISel] Create a new minimal combiner pass just for -O0.
authorAmara Emerson <amara@apple.com>
Fri, 7 May 2021 00:14:04 +0000 (17:14 -0700)
committerAmara Emerson <amara@apple.com>
Sat, 8 May 2021 00:01:27 +0000 (17:01 -0700)
commit5b158093e2469dec16a070019c6432d26bf7be9b
tree23a7ba8c9ed2f79f7420dba3de468f8d8d639206
parent808bc11d9e1aa01edaf7ec4e56be3aee5ed42a83
[AArch64][GlobalISel] Create a new minimal combiner pass just for -O0.

We never bothered to have a separate set of combines for -O0 in the prelegalizer
before. This results in some minor performance hits for a mode where performance
isn't a concern (although not regressing code size significantly is still preferable).

This also removes the CSE option since we don't need it for -O0.

Through experiments, I've arrived at a set of combines that gets the most code
size improvement at -O0, while reducing the amount of time spent in the combiner
by around 35% give or take.

Differential Revision: https://reviews.llvm.org/D102038
12 files changed:
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/Target/AArch64/AArch64.h
llvm/lib/Target/AArch64/AArch64Combine.td
llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
llvm/lib/Target/AArch64/CMakeLists.txt
llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp
llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.h
llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp [new file with mode: 0644]
llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
llvm/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll
llvm/test/CodeGen/AArch64/O0-pipeline.ll
llvm/test/CodeGen/AArch64/combine-loads.ll [deleted file]