<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><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><div class=""><br class=""></div><div class="">But when testing on x86, this crashes with the assertion “<font face="Menlo" class=""><span style="font-size: 11px;" class="">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><div class=""><br class=""></div><div class=""></div></body></html>