<div dir="ltr"><p dir="ltr">Unfortunately, it's not my lowering code.  This change triggers a legalization loop in CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll when X86 is used as the default.  The X86 target lowers an i64 extract_vector_elt to itself, causing the loop.  I don't know enough about the X86 custom lowering code to know where to start looking.  I'll see if I can identify the issue.<br>
</p>
<div class="gmail_quote">On Jul 22, 2013 6:05 PM, "Eli Friedman" <<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

On Mon, Jul 22, 2013 at 10:10 AM, Justin Holewinski<br>
<<a href="mailto:justin.holewinski@gmail.com" target="_blank">justin.holewinski@gmail.com</a>> wrote:<br>
> CustomLowerNode was not being called during SplitVectorOperand,<br>
> meaning custom legalization could not be used by targets.<br>
><br>
> Is there a reason this is missing, or just an oversight?<br>
><br>
> This also adds a test case for NVPTX that depends on this custom<br>
> legalization.<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1195" target="_blank">http://llvm-reviews.chandlerc.com/D1195</a><br>
><br>
> Files:<br>
>   lib/CodeGen/SelectionDAG/LegalizeTypes.cpp<br>
>   lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp<br>
>   test/CodeGen/NVPTX/vector-stores.ll<br>
><br>
> Index: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp<br>
> ===================================================================<br>
> --- lib/CodeGen/SelectionDAG/LegalizeTypes.cpp<br>
> +++ lib/CodeGen/SelectionDAG/LegalizeTypes.cpp<br>
> @@ -919,6 +919,11 @@<br>
>      // The target didn't want to custom lower it after all.<br>
>      return false;<br>
><br>
> +  if (!LegalizeResult && Results[0].getNode() == N)<br>
> +    // The target just returned the same node, so it must not have wanted to<br>
> +    // custom lower it after all.<br>
> +    return false;<br>
<br>
Please fix your custom lowering implementation...<br>
<br>
>    // Make everything that once used N's values now use those in Results instead.<br>
>    assert(Results.size() == N->getNumValues() &&<br>
>           "Custom lowering returned the wrong number of results!");<br>
> Index: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp<br>
> ===================================================================<br>
> --- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp<br>
> +++ lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp<br>
> @@ -1031,6 +1031,10 @@<br>
>          dbgs() << "\n");<br>
>    SDValue Res = SDValue();<br>
><br>
> +  // See if the target wants to custom split this node.<br>
> +  if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false))<br>
> +    return false;<br>
> +<br>
>    if (Res.getNode() == 0) {<br>
>      switch (N->getOpcode()) {<br>
>      default:<br>
<br>
This looks fine.<br>
<br>
-Eli<br>
</blockquote></div>
</div>