<div dir="auto"><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Hi Krzysztof,</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Sure, please see below. DAG.dump.() before and after, annotated with what I believe the DAG means.</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">I've spent some time debugging the method but it's proving difficult to determine where the logic is misfiring. Disabling the entire combine causes a lot of failing x86-64 tests - I may have to learn an upstream vector ISA to make progress on this.</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Thank you</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br><div style="height:87px" dir="auto"><span style="font-size:12.8px">From your description it seems like you are seeing an incorrect</span><br style="font-size:12.8px"><span style="font-size:12.8px">behavior. If that's the case, it should definitely be fixed. Could you</span><br style="font-size:12.8px"><span style="font-size:12.8px">provide the complete DAG before and after the erroneous transformation?</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">-Krzysztof</span></div><div style="height:87px" dir="auto"><br></div><div style="height:87px" dir="auto"><span style="font-size:11pt">Combining: t25: v2i16 = BUILD_VECTOR t27, t22</span></div><div style="margin:16px 0px" dir="auto"><p><span style="font-size:11pt">Before reduceBuildVecToShuffle<u></u><u></u></span></p><p><span style="font-size:11pt">SelectionDAG has 14 nodes:<u></u><u></u></span></p><p><span style="font-size:11pt">  t0: ch = EntryToken<u></u><u></u></span></p><p><span style="font-size:11pt">  t2: v4i16,ch = CopyFromReg t0, Register:v4i16 %0 // [a b c d]<u></u><u></u></span></p><p><span style="font-size:11pt">        t26: v2i16 = extract_subvector t2, Constant:i32<0> // [a b]<u></u><u></u></span></p><p><span style="font-size:11pt">      t27: i16 = extract_vector_elt t26, Constant:i32<0> // [a]<u></u><u></u></span></p><p><span style="font-size:11pt">        t21: v2i16 = extract_subvector t2, Constant:i32<2> //[c d]<u></u><u></u></span></p><p><span style="font-size:11pt">      t22: i16 = extract_vector_elt t21, Constant:i32<0> // [c]<u></u><u></u></span></p><p><span style="font-size:11pt">    t25: v2i16 = BUILD_VECTOR t27, t22 // [a c]<u></u><u></u></span></p><p><span style="font-size:11pt">  t18: ch,glue = CopyToReg t0, Register:v2i16 %m0, t25<u></u><u></u></span></p><p><span style="font-size:11pt">    t19: ch = RTN t18<u></u><u></u></span></p><p><span style="font-size:11pt">  t20: ch = RTN_REG_HOLDER t19, Register:v2i16 %m0, t18:1<u></u><u></u></span></p><p><span style="font-size:11pt"><u></u> <u></u></span></p><p><span style="font-size:11pt"><u></u> <u></u></span></p><p><span style="font-size:11pt">Creating new node: t28: v2i16 = undef<u></u><u></u></span></p><p><span style="font-size:11pt">Creating new node: t29: v2i16 = vector_shuffle<0,0> t26, undef:v2i16<u></u><u></u></span></p><p><span style="font-size:11pt">After reduceBuildVecToShuffle<u></u><u></u></span></p><p><span style="font-size:11pt">SelectionDAG has 16 nodes:<u></u><u></u></span></p><p><span style="font-size:11pt">  t0: ch = EntryToken<u></u><u></u></span></p><p><span style="font-size:11pt">  t2: v4i16,ch = CopyFromReg t0, Register:v4i16 %0 // [a b c d]<u></u><u></u></span></p><p><span style="font-size:11pt">      t27: i16 = extract_vector_elt t26, Constant:i32<0><u></u><u></u></span></p><p><span style="font-size:11pt">        t21: v2i16 = extract_subvector t2, Constant:i32<2><u></u><u></u></span></p><p><span style="font-size:11pt">      t22: i16 = extract_vector_elt t21, Constant:i32<0><u></u><u></u></span></p><p><span style="font-size:11pt">    t25: v2i16 = BUILD_VECTOR t27, t22<u></u><u></u></span></p><p><span style="font-size:11pt">  t18: ch,glue = CopyToReg t0, Register:v2i16 %m0, t25<u></u><u></u></span></p><p><span style="font-size:11pt">  t26: v2i16 = extract_subvector t2, Constant:i32<0> // [a b]<u></u><u></u></span></p><p><span style="font-size:11pt">  t29: v2i16 = vector_shuffle<0,0> t26, undef:v2i16 // [a a]<u></u><u></u></span></p><p><span style="font-size:11pt">    t19: ch = RTN t18<u></u><u></u></span></p><p><span style="font-size:11pt">  t20: ch = RTN_REG_HOLDER t19, Register:v2i16 %m0, t18:1<u></u><u></u></span></p><p><span style="font-size:11pt"><u></u> <u></u></span></p><p><span style="font-size:11pt"><u></u> <u></u></span></p><p><span style="font-size:11pt">... into: t29: v2i16 = vector_shuffle<0,0> t26, undef:v2i16<br></span></p></div></div></div>