<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 01/26/2015 04:35 PM, Fiona Glaser
      wrote:<br>
    </div>
    <blockquote
      cite="mid:310CA9BE-7A33-463F-A5BC-7E3074A4FD91@apple.com"
      type="cite">
      <div class="">On an out-of-tree target, IR similar to the attached
        causes the emission of the following instructions (pseudocode):</div>
      <div class=""><br class="">
      </div>
      <div class="">setcc dst16, cc</div>
      <div class="">zext dst32, dst16</div>
      <div class=""><br class="">
      </div>
      <div class="">The attached patch fixes it to be the expected:</div>
      <div class=""><br class="">
      </div>
      <div class="">setcc dst32, cc</div>
      <div class=""><br class="">
      </div>
      <div class="">because the out-of-tree target supports 32-bit
        setcc.</div>
    </blockquote>
    <br>
    Does it also support 16-bit setcc result types or return different
    sized types for different compared types? I don't think this patch
    is generally correct. It isn't correct to blindly promote the setcc
    type, especially with any given promotion type. At the very least
    this would only be valid to combine zext if the target's boolean
    content is ZeroOrOneBooleanContent etc. setccs should only be
    created with a type from getSetCCResultType, and any random extended
    type you give it probably won't work<br>
    <br>
    -Matt<br>
    <br>
    <br>
    <blockquote
      cite="mid:310CA9BE-7A33-463F-A5BC-7E3074A4FD91@apple.com"
      type="cite">
      <div class=""><br class="">
      </div>
      <div class="">But when testing on x86, this crashes with the
        assertion “<font class="" face="Menlo"><span class=""
            style="font-size:11px">Assertion failed:
            (((!Subtarget->hasAVX512() && VT == MVT::i8) ||
            (VT == MVT::i1)) && "SetCC type must be 8-bit or
            1-bit integer”)</span></font>”. If I remove the !LegalTypes
        condition, it works fine, but this means that canonicalizing to
        a non-legal type prior to type legalization is somehow breaking
        x86.</div>
      <div class=""><br class="">
      </div>
      <div class="">Does anyone have any idea what’s going on here, or
        if I’m just approaching this entirely wrong?</div>
      <div class=""><br class="">
      </div>
      <div class="">Fiona</div>
      <div class=""><br class="">
      </div>
    </blockquote>
    <br>
  </body>
</html>