[PATCH] D52432: [PowerPC] Remove self-copies in pre-emit peephole
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 24 12:33:36 PDT 2018
nemanjai created this revision.
nemanjai added reviewers: hfinkel, echristo, kbarton, jsji.
There are occasionally instances where AADB rewrites registers in such a way that a reg-reg copy becomes a self-copy. Such an instruction is obviously redundant and can be removed. This patch does precisely that.
Note that this will not remove various `nop`'s that we insert (which are themselves just self-copies). The reason those are left alone is that all of them have their own opcodes (that just encode to a self-copy).
What prompted this patch is the fact that these self-copies sometimes end up using registers that make the instruction a priority-setting nop, thereby having a significant effect on performance.
Repository:
rL LLVM
https://reviews.llvm.org/D52432
Files:
lib/Target/PowerPC/PPCPreEmitPeephole.cpp
test/CodeGen/PowerPC/remove-self-copies.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52432.166734.patch
Type: text/x-patch
Size: 6157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180924/066fa92b/attachment.bin>
More information about the llvm-commits
mailing list