<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Feb 9, 2007, at 7:42 PM, Chris Lattner wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Fri, 9 Feb 2007, Scott Michel wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I would have expected four additional patterns, each with the (and $rC, $rA)<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">variant in it. But I only get the above four.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Is this a bug or a feature? :-)</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This is a feature.<SPAN class="Apple-converted-space">  </SPAN>They would match the same pattern, so it would just be<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">generating dead code.<SPAN class="Apple-converted-space">  </SPAN>For the same reason, if you write something like:</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>I'm not sure how much of a feature that is -- evidently, in my particular case, enumerating all eight variants ends up generating the desired code. Leaving llvm to its own devices doesn't generate the desired code. I would have expected that the "(and $rA, $rC)" to match "(and $rC, $rA)", were they inverted, but it doesn't get generated in my test code.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Generated patterns:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rA, $rC), (and $rB, (not $rC)))  # original</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rA, $rC), (and (not $rC), $rB))</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rB, (not $rC)), (and $rA, $rC))</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and (not $rC), $rB), (and $rA, $rC))</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Missing patterns:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rC, $rA), (and $rB, (not $rC)))</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rC, $rA), (and (not $rC), $rB))</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and $rB, (not $rC)), (and $rC, $rA))</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Courier">(or (and (not $rC), $rB), (and $rC, $rA))</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-scooter</DIV><BR></BODY></HTML>