[PATCH] D28527: Check for register clobbers when merging a vreg live range with a reserved physreg in RegisterCoalescer.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 08:27:47 PST 2017


jyknight added a comment.

In https://reviews.llvm.org/D28527#641748, @MatzeB wrote:

> Makes sense, I am surprised this didn't hit us before.
>
> Could you create a .mir based test that just runs the coalescer instead of the .ll one?


I noted the existing MIR test in AArch64/regcoal-physreg.mir, and added another test-case there.

I also noticed while writing this new test case that MachineRegisterInfo::isConstantPhysReg treats any register without a visible def in the function as "constant". And thus, the newly added test case doesn't work -- it will coalesce -- without the "%x18 = COPY %xzr" line.

I'm not sure this is correct behavior, since it *also* fails to take into account regmasks, but I also don't know if there's a situation where it would actually matter -- in the actual case I'm looking  at, the inlineasm is a def of the register, so that's fine.


https://reviews.llvm.org/D28527





More information about the llvm-commits mailing list