<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 5:38 PM, Gerolf Hoflehner via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">What is a good way to collect test cases for GISel expectations (in this case handle i1 efficiently)? It would be great to build up a repository of tests as opportunities/potentials pop up. </div></blockquote><div><br></div><div>Add a section at the bottom of docs/GlobalISel.rst</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Thanks</div><div>Gerolf</div><div><div class="gmail-h5"><div><br><div><blockquote type="cite"><div>On Jan 24, 2017, at 7:34 AM, Hal Finkel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_2964821282448730577Apple-interchange-newline"><div><div class="gmail-m_2964821282448730577moz-cite-prefix" style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br class="gmail-m_2964821282448730577Apple-interchange-newline">On 01/24/2017 05:54 AM, Blank, Guy via llvm-dev wrote:<br></div><blockquote type="cite" style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><div class="gmail-m_2964821282448730577WordSection1"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Hi All,<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">AVX-512 introduced the K mask registers and masked operations which make a natural choice for legalizing vectors of i1’s.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">For example,<br><br><u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">define <8 x i32> @foo(<8 x i32>%a, <8 x i32*> %p) {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>%r = call <8 x i32> @llvm.masked.gather.v8i32(<8 x i32*> %p, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i32> undef)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>ret 8 x i32>%r<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Can be lowered to<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"># BB#0:<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">kxnorw    %k0, %k0, %k1<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">vpgatherqd    (,%zmm1), %ymm0 {%k1}<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">retq<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Legal vectors of i1’s require support for BUILD_VECTOR(i1, i1, .., i1), i1 EXTRACT_VEC_ELEMENT (…) and INSERT_VEC_ELEMENT(i1, …) , so making i1 legal seemed like a sensible decision, and this is the current state in the top of trunk.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">However, making i1 legal affected instruction selection of scalar code as well. Currently, there are cases where operations producing or consuming i1’s are selected (sub-optimally) to instructions that act on K-regs.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><a href="https://llvm.org/bugs/show_bug.cgi?id=28650" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">PR28650</a><span class="gmail-m_2964821282448730577Apple-converted-space"> </span>is an example showing that i1’s live-in or live-out of basic-blocks are being selected to K register classes, even though we don’t want this to happen. This problem does not happen on subtargets without the AVX-512 feature enabled.<br>The following is the AVX-512 code from the bug report:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"># BB#0:                         <wbr>        # %entry<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">testb        $1, %dil<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">je        .LBB0_1<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"># BB#2:                         <wbr>        # %if<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">pushq        %rax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">callq        bar<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">                              <wbr>         <span class="gmail-m_2964821282448730577Apple-converted-space"> </span># kill: %AL<def> %AL<kill> %EAX<def><u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">andl        $1, %eax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">kmovw        %eax, %k0<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">addq        $8, %rsp<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">jmp        .LBB0_3<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">.LBB0_1:<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">kxnorw        %k0, %k0, %k0<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">kshiftrw        $15, %k0, %k0<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">.LBB0_3:                      <wbr>          # %else<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">kmovw        %k0, %eax<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">                              <wbr>         <span class="gmail-m_2964821282448730577Apple-converted-space"> </span># kill: %AL<def> %AL<kill> %EAX<kill><u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">Retq<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">The kmov,kxnor,kshiftr instructions here are the instructions operating on K registers. These are undesirable in the purely scalar input code.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Having a type that can be possibly legalized to two different register classes exposes a fundamental limitation of the current instruction selection framework, and that is we cannot always make the right decision about live-in/live-out i1’s because we cannot see beyond the boundary of the current basic-block we are visiting. As a side-note, with GlobalISel this can be solved, since we see the entire use-def chain at the function level.</span></div></div></blockquote><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">Exactly. I certainly hope we'll be able to address this sensibly with GlobalISel.</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><blockquote type="cite" style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><div class="gmail-m_2964821282448730577WordSection1"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Our initial thought was to write a pass that will be run after ISel to correct bad selections. The pass would examine the use-def chains containing values that were selected to K-regsiter classes, and, when profitable, re-assign the values to GPR register classes (and replace the producing/consuming instructions accordingly). But even with this fix-up pass, we would still be losing many ISel pattern-matching rules that will be missed because the instruction set acting on GPR is richer than the instruction set acting on K-regs. For example, a test trying to match the sbb instruction:</span></div></div></blockquote><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">I think you'd want to do the fixup for these before/during isel, not afterward. PowerPC does some of this (see lib/Target/PowerPC/<wbr>PPCBoolRetToInt.cpp and DAGCombineTruncBoolExt/<wbr>DAGCombineExtBoolTrunc in lib/Target/PowerPC/<wbr>PPCISelLowering.cpp). That code should trivially generalize to other targets.</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">There are some places where we do this kind of thing after isel as well (e.g. lib/Target/AArch64/<wbr>AArch64AdvSIMDScalarPass.cpp).</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">That having been said, if you don't have actual i1 registers in which you'd like to keep and manipulate boolean values, marking i1 as illegal makes sense to me.</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline"> -Hal</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><blockquote type="cite" style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><div class="gmail-m_2964821282448730577WordSection1"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">define i32 @test2(i32 %x, i32 %y, i32 %res) nounwind uwtable readnone ssp {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">entry:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>%cmp = icmp ugt i32 %x, %y<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>%dec = sext i1 %cmp to i32<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>%dec.res = add nsw i32 %dec, %res<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <span class="gmail-m_2964821282448730577Apple-converted-space"> </span>ret i32 %dec.res<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Generates the following with AVX2:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"># BB#0:                         <wbr>        # %entry<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">cmpl        %edi, %esi<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">sbbl        $0, %edx<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">movl        %edx, %eax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">retq<u></u><u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">While AVX512 produces:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"># BB#0:                         <wbr>        # %entry<u></u><u></u></span></div><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">xorl        %ecx, %ecx<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">cmpl        %esi, %edi<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">movl        $-1, %eax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">cmovbel        %ecx, %eax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">addl        %edx, %eax<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif">retq<u></u><u></u></span></p><p style="margin-right:0in;margin-left:27pt;font-size:12pt;font-family:"times new roman",serif;margin-bottom:0.0001pt"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></p><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">So we would still end-up with cases where when the AVX-512 feature is enabled, instruction selection for scalar code becomes inferior.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Finally, we suggest to undo the above issues cause by legalizing i1, by making i1 illegal. This would make instruction selection of scalar code identical for both cases when the AVX-512 feature is on and off. As for supporting BUILD_VECTOR, EXTRACT_VEC_ELEMENT and INSERT_VEC_ELEMENT, we believe we can support these operations even when i1 is illegal and the vectors of i1 *<b>are</b>* legal by using the i8 type instead of i1, as it should be implicitly truncated/extended to the element type of the vNi1 vectors.<span class="gmail-m_2964821282448730577Apple-converted-space"> </span><br>I am now working on a patch that will implement this approach.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"> <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Would appreciate to get feedback and comments.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Thanks,<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif">Guy<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:"times new roman",serif"><span style="font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:calibri,sans-serif"><u></u> <u></u></div></div><p style="margin-right:0in;margin-left:0in;font-size:12pt;font-family:"times new roman",serif">------------------------------<wbr>------------------------------<wbr>---------<br>Intel Israel (74) Limited</p><p style="margin-right:0in;margin-left:0in;font-size:12pt;font-family:"times new roman",serif">This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</p><br><fieldset class="gmail-m_2964821282448730577mimeAttachmentHeader"></fieldset><br><pre>______________________________<wbr>_________________
LLVM Developers mailing list
<a class="gmail-m_2964821282448730577moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="gmail-m_2964821282448730577moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="color:rgb(149,79,114);text-decoration:underline" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a>
</pre></blockquote><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><pre class="gmail-m_2964821282448730577moz-signature" cols="72" style="font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">______________________________<wbr>_________________</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline">LLVM Developers mailing list</span><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><a href="mailto:llvm-dev@lists.llvm.org" style="color:rgb(149,79,114);text-decoration:underline;font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="color:rgb(149,79,114);text-decoration:underline;font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br style="font-family:helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>