[PATCH] D55403: [PHIElimination] Allow breaking loop backedges in certain cases.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 6 18:08:38 PST 2018
efriedma created this revision.
efriedma added reviewers: craig.topper, MatzeB, qcolombet.
This reduces the number of spills in some cases, like the new testcase phi-backedge-split.ll. It seems like it helps the allocator generate better code for PHIs where the operand is another PHI, since the implied COPY shouldn't really exist on any path other than the backedge.
It's possible the heuristic could be improved here; it seems like this makes the code slightly worse in a couple of the x86 regression tests, like CodeGen/X86/madd.ll. But I'm not really sure what else makes sense to check here; I mean, I could check if the predecessor vreg is specifically a PHI, but that seems hacky.
I'm not confident this is the best way to solve the spilling inefficiency I see in phi-backedge-split.ll, but I'm not sure what the alternative would look like.
Repository:
rL LLVM
https://reviews.llvm.org/D55403
Files:
lib/CodeGen/PHIElimination.cpp
test/CodeGen/Hexagon/swp-kernel-phi1.ll
test/CodeGen/Thumb/phi-backedge-split.ll
test/CodeGen/X86/bug26810.ll
test/CodeGen/X86/madd.ll
test/CodeGen/X86/sad.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55403.177089.patch
Type: text/x-patch
Size: 93606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/1450127b/attachment.bin>
More information about the llvm-commits
mailing list