[llvm-dev] how to type-legalize a dag

Rail Shafigulin via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 18 12:48:40 PDT 2016


On Fri, Mar 18, 2016 at 12:27 PM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On 18 March 2016 at 12:20, Rail Shafigulin via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Given that the action is "Expand" how does legalizer know which
> replacement
> > to use for a given operation?
>
> It's pretty random, and the only way to be sure is to read
> LegalizeDAG.cpp. The two basic variants are:
>
>   + Check whether the intended opcode is Legal, use that if possible,
> otherwise keep trying until you run out of ideas.
>   + Expand it to something, legal or not. Then that node will be
> expanded in turn.
>
> Obviously neither is guaranteed to terminate in a legal node (for
> example you could set absolutely everything to Expand in which case
> there's no solution).
>
> These heuristics tend to cover the common cases, but most targets need
> to mark at least a few nodes as Custom and handle them manually.
>
> Cheers.
>
> Tim.
>

Thanks!

-- 
Rail Shafigulin
Software Engineer
Esencia Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160318/f3a98a9b/attachment.html>


More information about the llvm-dev mailing list