<div dir="ltr">Hi all!<div><br></div><div>I'm trying to do instruction selection on a pattern like the following:</div><div><br></div><div>Pat<(v4i32 (build_vector (i32 (load I32:$addr)), (i32 (load I32:$addr)), (i32 (load I32:$addr)), (i32 (load I32:$addr))))), (LOAD_SPLAT 0, 0, I32:$addr)>;</div><div><br></div><div>Note that all those loads are actually the same load. This fails to match as expected because of the OPC_EmitMergeInputChains operation. There is a check at <a href="https://github.com/llvm/llvm-project/blob/20b52c33ba3960340ecf326314517091b8ec98f4/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp#L3304">https://github.com/llvm/llvm-project/blob/20b52c33ba3960340ecf326314517091b8ec98f4/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp#L3304</a> that the chain to be merged has only one use, but in this case it has four uses, all of which are matched in the same pattern.</div><div><br></div><div>I've tried updating the condition to allow this, but I haven't had any luck so far. Is there any other way to perform the match I want?</div></div>