[llvm-dev] Using `smullohi` in TableGen patterns

Dylan McKay via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 19 15:41:59 PST 2016


> You'd add extra CopyFromReg nodes, glued[1] to your multiplication node

Thanks makes a lot of sense, thanks Tim!

On Wed, Jan 20, 2016 at 4:45 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> > If I write a C++ matcher, will the register allocator work correctly? The
> > multiplication instruction I'm working with always writes the result to
> > registers `R1` and `R0`, but if that logic is in C++, how will the
> > regallocator know?
>
> You'd add extra CopyFromReg nodes, glued[1] to your multiplication
> node. The values produced by the CopyFromReg nodes are what other
> users should actually be using[2]. x86 has similar hard-coded
> registers on its multiplication operations, I believe. Try "llc
> -view-sched-dags ..." to see the kind of thing you should be
> producing.
>
> Cheers.
>
> Tim.
>
> [1] Glue is represented by producing/consuming a value of type MVT::Glue.
> [2] You may well have to manually call ReplaceAllUsesOfValueWith after
> creating them to make that happen.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160120/4e40ae31/attachment-0001.html>


More information about the llvm-dev mailing list