[PATCH] D40298: [PowerPC] Merge register copies

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 05:28:58 PST 2017


inouehrs created this revision.

This patch add an optimization to hoist and merge multiple register copies among BBs as illustrated below.

           BB1--------                           BB1--------
           | ..      |                           | ..      |
           |         |                           | mr Y, X |
           | bcc     |                           | bcc     |
           -----------                           -----------
           /         \                           /         \
  BB---------         BB---------      BB---------          BB---------
  | mr Y, X |         | mr Y, X |  =>  |(erased) |          |(erased) |
  | ..      |         | ..      |      | ..      |          | ..      |
  -----------         -----------      -----------          -----------

After the optimization, a BB will be erased if the BB becomes empty (i.e. only includes an unconditional branch).


https://reviews.llvm.org/D40298

Files:
  lib/Target/PowerPC/PPCRegCopyElim.cpp
  test/CodeGen/PowerPC/redundant_regcopy_3.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40298.123771.patch
Type: text/x-patch
Size: 11053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171121/c1f53adb/attachment-0001.bin>


More information about the llvm-commits mailing list