[PATCH] D17475: MachineCopyPropagation: Catch copies of the form A<-B; A<-B

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 11:23:15 PST 2016


MatzeB added a comment.

In http://reviews.llvm.org/D17475#362009, @junbuml wrote:

>   Uh, I think this has probably worked before and fails after my changes, I don't want to cause regressions here...
>   
>
> I don't think the case I mentioned above was handled even before your patch.


You are right, this wasn't possible before of course, because it was an A<-B; A<-B pattern.

I just discussed this a bit with Quentin and we think that eliminating the second copy in an "A<-B; A<-B" is invalid if B is a reserved register, because we cannot be sure that we are actually reading the same value. For an example look at ARM32s PC register. I'll probably take a few minutes to create a patch that adds some comments to TargetRegisterInfo that define what reserved registers mean.


Repository:
  rL LLVM

http://reviews.llvm.org/D17475





More information about the llvm-commits mailing list