[LLVMdev] Fwd: Some questions on SelectionDAG

Zakk zakk0610 at gmail.com
Tue Sep 6 18:57:22 PDT 2011


Thanks for all replies, they have been very helpful!

Note: Sorry, i forgot to group reply....

---------- Forwarded message ----------
From: Duncan Sands <baldrick at free.fr>
Date: 2011/9/4
Subject: Re: [LLVMdev] Some questions on SelectionDAG
To: Zakk <zakk0610 at gmail.com>


Hi Zak,


 Therefore, after the LegalizeType phase, maybe SelectionDAG have
> unsupported
> type node?
>

no.  As I tried to explain, there is no node with type MVT:i1 after type
legalization.  There is a VALUETYPE node with type MVT::Other that contains
the type MVT::i1 as an auxiliary datum.


 My confusion is the unsupported type( like MVT::i1) have converted
> to supported type in LegalizeTypes phase,
>

They have.


 but the setXXXXAction

> callbacks(like setLoadExtAction(ISD::**SEXTLOAD, MVT::i1, Promote);)
>

Here MVT::i1 is not referring to the type of any node, it is referring
to the extra data held in the VALUETYPE node argument of the SEXTLOAD
node.


 are used to eliminate any operations that are unsupported
> on the target in Legalize phase after then LegalizeType phase.
> (http://llvm.org/docs/**CodeGenerator.html#**selectiondag_legalize<http://llvm.org/docs/CodeGenerator.html#selectiondag_legalize>
> )
> Do I misunderstand any concept here?
>

Ciao, Duncan.


>
> Best regards,
>
> Zakk
>
>
>
>
> 2011/9/3 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>>
>
>
>    Hi Zakk,
>
>     > 3. In the ARMISelLowering constructor, it sets the callback function
> with
>     >
>     > setLoadExtAction(ISD::**SEXTLOAD, MVT::i1, Promote);
>     >
>     > My question is ARM don’t support MVT::i1 registerclass, why should it
>    determine
>     > this operation with MVT::i1 value?
>
>    note that i1 is not a result type or operand type for SEXTLOAD; it is an
>    auxiliary value stored in a VALUETYPE node (IIRC).  Thus the fact that
> i1
>    is not legal for this platform doesn't stop it from turning up, which is
>    why ARM needs to say what to do with it.  You might wonder why you can
> get i1
>    here and not i2.  That's because i1 is a simple value type, while i2
> isn't.
>    The reason i1 is a simple value type is because you can play some tricks
> with
>    it that result in better code for booleans; x86 pretends to support
> extending
>    loads from i1 for example for this reason.  Types like i2 are not
> interesting
>    in this way since they don't occur in practice, so they are left as
> extended
>    value types; the code generators zap all SEXTLOAD nodes that extend from
> an
>    extended value type automagically.
>
>    Ciao, Duncan.
>    ______________________________**_________________
>    LLVM Developers mailing list
>    LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
> http://llvm.cs.uiuc.edu
>
>    http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
>
>
>
>
>
>



-- 
Best regards,

Zakk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110907/3f1045a1/attachment.html>


More information about the llvm-dev mailing list