<div dir="ltr"><p style="margin:0px;line-height:normal"><font color="#232323" face="Arial"><span style="letter-spacing:0px">Is there an established way of disabling a DAG combine on a per target basis, where it appears to be detrimental to the generated code? Writing if (!mytarget) in DAGCombiner.cpp works </span>but tends to be erased by git merge and generally doesn't look ideal. Writing the inverse transform in target specific code doesn't work in this instance and in general creates an infinite loop.</font><br></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><br><span style="letter-spacing:0.0px"></span></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px">Guidance would be very welcome!</p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><br></p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px">Thanks</p><p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><br></p>
<p style="margin:0px;line-height:normal;background-color:rgb(251,252,253)"><span style="color:rgb(35,35,35);font-family:Arial;font-size:13px;letter-spacing:0px;background-color:transparent">For the curious, the specific instance I would like to avoid is </span><font color="#232323" face="Arial"><span style="letter-spacing:0px">reduceBuildVecToShuffle. It doesn't seem to have any target specific hooks. Exhaustive testing of x86-64 vector code doesn't show the error. I think the other in tree targets would notice the vector transform getting the answer wrong (it's harder to confirm without hardware), so the bug is probably inert for in tree targets.</span></font></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><br><span style="letter-spacing:0.0px"></span></p>
<p style="margin:0px;line-height:normal"><font face="Arial"><span style="letter-spacing:0px">Given a v4f16 instance t2, the DAG describes building a v2f16 vector from elements [0, 2]. The combine translates this to building a vector from elements [0, 0]. The problem seems to be treating extract_subvector with different </span>constants<span style="letter-spacing:0px"> as instances of the same value.</span></font></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><span style="letter-spacing:0.0px"></span><br></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px">t14: v2f16 = extract_subvector t2, Constant:i32<2></span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px">t15: f16 = extract_vector_elt t14, Constant:i32<0></span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px">t16: v2f16 = extract_subvector t2, Constant:i32<0></span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px">t17: f16 = extract_vector_elt t16, Constant:i32<0></span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><span style="letter-spacing:0.0px"></span><br></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px">t9: v2f16 = BUILD_VECTOR t17, t15</span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial;min-height:15px"><span style="letter-spacing:0.0px"></span><br></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:Arial"><span style="letter-spacing:0.0px"> ... into: t19: v2f16 = vector_shuffle<0,0> t16, undef:v2f16 // fail<span class="sewao9b61q4q1dh"></span></span></p></div>