r305918 and "Bad machine code: Using an undefined physical register"

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 09:59:33 PDT 2017


On 26 Jun 2017, at 09:52, Jasty, Ananth <Ananth.Jasty at cavium.com> wrote:
> It looks like it's trying to use bl for a blr, so the address mode flags definitely make sense.

I don't think so. It's calling a global address directly (vscanf), so no need for a BLR. %X1 is involved because all calls have implicit uses of the registers arguments get passed in.

In this case %X1 is marked as killed earlier, by a MOV (cunningly disguised as an ORR). One of the things the LoadStore pass does, and particularly the bit that was modified, is forward stored values on to later loads (converting the load into a MOV).

I think what's actually happening is that parent code is forwarding from the second register in an STP, but r305918 is trying to get the kill flag from the first (unaware that a pair is involved at all). I'll ping the person who wrote it.

Tim.


More information about the llvm-commits mailing list