Thanks, I didn't remember check-dag. Btw, if we use check-dag, we wouldn't need the %xmm{{[01]}} regex either! unless I'm looking at it wrong.<div><br></div><div>I'll commit later today.</div><div><br></div>
<div>Thank you,</div><div><br></div><div>Filipe<br><br>On Friday, May 30, 2014, <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Aside from fixing up the test, this LGTM.<br>
<br>
================<br>
Comment at: test/CodeGen/X86/vselect.ll:269<br>
@@ +268,3 @@<br>
+; CHECK: movlhps %xmm{{[23]}}, %xmm{{[01]}}<br>
+; CHECK: movlhps %xmm{{[23]}}, %xmm{{[01]}}<br>
+; CHECK: addps %xmm{{[01]}}, %xmm{{[01]}}<br>
----------------<br>
I think can be made a little more specific. You know what the input registers are (because they're dictated by the calling convention), so you can do something like this:<br>
<br>
  ; CHECK-DAG: movlhps %xmm2, %xmm{{[01]}}<br>
  ; CHECK-DAG: movlhps %xmm3, %xmm{{[01]}}<br>
<br>
(where the CHECK-DAGs can match in either order). Because the add is commutative, it is hard to pattern match the resulting registers in a stable way (because they could be flipped). If you make the test use a subtract (so that the correct order is fixed), then we can be even more specific:<br>

<br>
  ; CHECK-DAG: movlhps %xmm2, %[[REG1:[xmm[01]]]]<br>
  ; CHECK-DAG: movlhps %xmm3, %[[REG2:[xmm[01]]]]<br>
  ; CHECK-NEXT: subps [[REG1]], [[REG2]]<br>
(or something like that).<br>
<br>
<a href="http://reviews.llvm.org/D3916" target="_blank">http://reviews.llvm.org/D3916</a><br>
<br>
<br>
</blockquote></div>