<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 2/21/2017 4:47 PM, Matt Arsenault
      wrote:<br>
    </div>
    <blockquote
      cite="mid:7C7B31CB-6FEE-448C-97E8-87EC712B4080@gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <br class="">
      <div>
        <blockquote type="cite" class="">
          <div class="">On Feb 21, 2017, at 16:39, Friedman, Eli via
            llvm-commits <<a moz-do-not-send="true"
              href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class=""><span style="font-family: Helvetica; font-size:
              12px; font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">On 2/21/2017 2:47 PM, Matt
              Arsenault via llvm-commits wrote:</span><br
              style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <blockquote type="cite" style="font-family: Helvetica;
              font-size: 12px; font-style: normal; font-variant-caps:
              normal; font-weight: normal; letter-spacing: normal;
              orphans: auto; text-align: start; text-indent: 0px;
              text-transform: none; white-space: normal; widows: auto;
              word-spacing: 0px; -webkit-text-size-adjust: auto;
              -webkit-text-stroke-width: 0px;" class="">Author: arsenm<br
                class="">
              Date: Tue Feb 21 16:47:27 2017<br class="">
              New Revision: 295782<br class="">
              <br class="">
              URL: <a moz-do-not-send="true"
                href="http://llvm.org/viewvc/llvm-project?rev=295782&view=rev"
                class="">http://llvm.org/viewvc/llvm-project?rev=295782&view=rev</a><br
                class="">
              Log:<br class="">
              DAG: Check if extract_vector_elt is legal or custom<br
                class="">
              <br class="">
              Avoids test regressions in future AMDGPU commits when<br
                class="">
              more vector types are custom lowered.<br class="">
              <br class="">
              Modified:<br class="">
                  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br
                class="">
              <br class="">
              Modified:
              llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br
                class="">
              URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=295782&r1=295781&r2=295782&view=diff"
                class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=295782&r1=295781&r2=295782&view=diff</a><br
                class="">
==============================================================================<br
                class="">
              --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
              (original)<br class="">
              +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
              Tue Feb 21 16:47:27 2017<br class="">
              @@ -7882,7 +7882,7 @@ SDValue
              DAGCombiner::visitTRUNCATE(SDNod<br class="">
                   EVT SrcVT = VecSrc.getValueType();<br class="">
                   if (SrcVT.isVector() && SrcVT.getScalarType()
              == VT &&<br class="">
                       (!LegalOperations ||<br class="">
              -         TLI.isOperationLegal(ISD::EXTRACT_VECTOR_ELT,
              SrcVT))) {<br class="">
              +
                      TLI.isOperationLegalOrCustom(ISD::EXTRACT_VECTOR_ELT,
              SrcVT))) {<br class="">
                     SDLoc SL(N);<br class="">
                       EVT IdxVT =
              TLI.getVectorIdxTy(DAG.getDataLayout());<br class="">
              <br class="">
            </blockquote>
            <br style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">This doesn't work.  If
              LegalOperations is true, we're creating an operation which
              isn't legal after the legalizer has run, so a operation
              marked CUSTOM could fail to match.  (For example, on
              AArch64, we custom-lower EXTRACT_VECTOR_ELT on 64-bit
              vectors by widening them to 128-bit vectors.)</span><br
              style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <br style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">If you're running into
              trouble with this, maybe it makes sense to add a specific
              helper here, along the lines of isShuffleMaskLegal?</span><br
              style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <br style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px;" class="">
            <span style="font-family: Helvetica; font-size: 12px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; orphans:
              auto; text-align: start; text-indent: 0px; text-transform:
              none; white-space: normal; widows: auto; word-spacing:
              0px; -webkit-text-stroke-width: 0px; float: none; display:
              inline !important;" class="">-Eli</span><br class="">
          </div>
        </blockquote>
        <br class="">
      </div>
      <div>I don’t think that’s true since r214020? The pattern of
        checking isLegalOrCustom is repeated in a variety of places (I’m
        not sure we even really want to use isLegal anywhere anymore)</div>
      <br>
    </blockquote>
    <br>
    Is there documentation somewhere of exactly which illegal nodes
    DAGCombine is allowed to generate after legalization?  Or is there
    just an implicit contract that targets aren't allowed to
    custom-lower nodes in ways which contradict DAGCombine transforms?<br>
    <br>
    -Eli<br>
    <pre class="moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
  </body>
</html>