This is an archive of the discontinued LLVM Phabricator instance.

[MachineCopyPropagation] Improve redundant copy elimination
Needs ReviewPublic

Authored by aivchenk on Jul 31 2018, 7:24 AM.

Details

Summary
We can go a little further and delete the first copy here as well:
   %R1 = COPY %R0         << Redundant
   ... // No clobber of %R1 and no uses of %R1 defined by the first copy.
   %R0 = COPY killed %R1  << Redundant
In other words, The first copy is only used for defining a reg
that is used only in the second copy.

Previously, we deleted only the second copy as redundant.

Diff Detail

Event Timeline

aivchenk created this revision.Jul 31 2018, 7:24 AM

Please don't wait months to ping on a patch; if you haven't gotten any response in a week, please ping, and if you haven't gotten any response in a couple weeks, please email llvmdev. We want to review patches in a timely fashion, but sometimes reviewers miss an email, or incorrectly expect someone else will review the patch.

I just tried your testcase, and it looks like it passes without your patch. What new cases does this patch handle?