[PATCH] D41835: [MachineCopyPropagation] Extend pass to do COPY source forwarding

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 13:09:34 PST 2018



> On Feb 2, 2018, at 12:55 PM, Quentin Colombet <qcolombet at apple.com> wrote:
> 
> 
> 
>> On Feb 2, 2018, at 12:21 PM, escha at apple.com <mailto:escha at apple.com> wrote:
>> 
>> I mean, in that case we are likely to have to mark every single opcode (all 12,000 or so) with this requirement. At that point we might as well just opt out of the pass, I think? At least, it feels like a gross hack that papers over the fact that LLVM has changed how register classes work such that our entire approach is no longer valid.
>> 
>> Also, it seems very weird to make this constraint-violating behavior *opt-out*. Maybe it should be opt-in, i.e. put doesNotHaveExtraSrcRegAllocReq on all instructions it’s okay for?
> 
> That sounds like a better approach to me.
> After talking with escha, I agree that TableGen is not necessarily expressive enough to model all the constraints that need to be met and I would err on the safe side of being opt-in instead of opt-out.

this is actually worse than i initially realized. one of our targets is VLIW and is completely broken by this patch, *even if we opt out as described*, because it doesn’t iterate over the operands of a bundle. so for example:

r3 = COPY foo
BUNDLE_TYPE_FOO
<thing that uses r3>
END

it believes that r3 is dead because it doesn’t iterate over the bundle operands, so it never sees the use of r3.

—escha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180202/c0a50d11/attachment.html>


More information about the llvm-commits mailing list