<div>Thanks for all replies, they have been very helpful!</div><div><br></div><div>Note: Sorry, i forgot to group reply....</div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Duncan Sands</b> <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span><br>
Date: 2011/9/4<br>Subject: Re: [LLVMdev] Some questions on SelectionDAG<br>To: Zakk <<a href="mailto:zakk0610@gmail.com">zakk0610@gmail.com</a>><br><br><br>Hi Zak,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Therefore, after the LegalizeType phase, maybe SelectionDAG have unsupported<br>
type node?<br>
</blockquote>
<br></div>
no. As I tried to explain, there is no node with type MVT:i1 after type<br>
legalization. There is a VALUETYPE node with type MVT::Other that contains<br>
the type MVT::i1 as an auxiliary datum.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My confusion is the unsupported type( like MVT::i1) have converted<br>
to supported type in LegalizeTypes phase,<br>
</blockquote>
<br></div>
They have.<div class="im"><br>
<br>
but the setXXXXAction<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
callbacks(like setLoadExtAction(ISD::<u></u>SEXTLOAD, MVT::i1, Promote);)<br>
</blockquote>
<br></div>
Here MVT::i1 is not referring to the type of any node, it is referring<br>
to the extra data held in the VALUETYPE node argument of the SEXTLOAD<br>
node.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
are used to eliminate any operations that are unsupported<br>
on the target in Legalize phase after then LegalizeType phase.<br>
(<a href="http://llvm.org/docs/CodeGenerator.html#selectiondag_legalize" target="_blank">http://llvm.org/docs/<u></u>CodeGenerator.html#<u></u>selectiondag_legalize</a>)<br>
Do I misunderstand any concept here?<br>
</blockquote>
<br></div>
Ciao, Duncan.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Best regards,<br>
<br>
Zakk<br>
<br>
<br>
<br>
<br>
2011/9/3 Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a> <mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>><div class="im"><br>
<br>
Hi Zakk,<br>
<br>
> 3. In the ARMISelLowering constructor, it sets the callback function with<br>
><br>
> setLoadExtAction(ISD::<u></u>SEXTLOAD, MVT::i1, Promote);<br>
><br>
> My question is ARM don’t support MVT::i1 registerclass, why should it<br>
determine<br>
> this operation with MVT::i1 value?<br>
<br>
note that i1 is not a result type or operand type for SEXTLOAD; it is an<br>
auxiliary value stored in a VALUETYPE node (IIRC). Thus the fact that i1<br>
is not legal for this platform doesn't stop it from turning up, which is<br>
why ARM needs to say what to do with it. You might wonder why you can get i1<br>
here and not i2. That's because i1 is a simple value type, while i2 isn't.<br>
The reason i1 is a simple value type is because you can play some tricks with<br>
it that result in better code for booleans; x86 pretends to support extending<br>
loads from i1 for example for this reason. Types like i2 are not interesting<br>
in this way since they don't occur in practice, so they are left as extended<br>
value types; the code generators zap all SEXTLOAD nodes that extend from an<br>
extended value type automagically.<br>
<br>
Ciao, Duncan.<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br></div>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><div class="im">
<br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
</div></blockquote>
<br>
</div><br><br clear="all"><div><br></div>-- <br>Best regards,<div><br>Zakk<br><br><br>
</div>