[PATCH] D95703: [GlobalISel] Propagate extends through G_PHIs into the incoming value blocks.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 15:06:02 PST 2021
aemerson created this revision.
aemerson added reviewers: paquette, arsenm, foad.
aemerson added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
aemerson requested review of this revision.
Herald added a subscriber: wdng.
This combine tries to do inter-block hoisting of extends of G_PHIs, into the originating blocks of the phi's incoming value. The idea is to expose further optimization opportunities that are normally obscured by the PHI.
Some basic heuristics, and a target hook for AArch64 is added, to allow tuning. E.g. if the extend is used by a G_PTR_ADD, it doesn't perform this combine since it may be folded into the addressing mode during selection.
There are very minor code size improvements on AArch64 -Os, but the real benefit is that it unlocks optimizations like AArch64 conditional compares on some benchmarks.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D95703
Files:
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/CodeGen/TargetInstrInfo.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-prop-extends-phi.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95703.320224.patch
Type: text/x-patch
Size: 24711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210129/509ba8ca/attachment.bin>
More information about the llvm-commits
mailing list