[PATCH] D95406: [GlobalISel][Localizer] Don't localize phi operands which are used more than once in the phi.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 16:05:28 PST 2021
aemerson created this revision.
aemerson added reviewers: paquette, arsenm.
aemerson added a project: LLVM.
Herald added subscribers: hiraditya, rovka.
aemerson requested review of this revision.
Herald added a subscriber: wdng.
The current algorithm just tries to localize defs as far as they can go, and in the case of G_PHI operands, it clones the def into the predecessor block for each incoming edge. When multiple edges have the same register value, this can cause unnecessary code bloat, and inhibit later optimizations.
This change checks if a given phi operand is unique in the phi, if not the def of that register is not localized to the predecessor.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D95406
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: D95406.319156.patch
Type: text/x-patch
Size: 4148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210126/fb877a90/attachment.bin>
More information about the llvm-commits
mailing list