<div dir="ltr">Yes, that triggers it. Here's an updated patch that uses the test you suggest and uses FileCheck to make sure that the right IR is generated from llvm-dis. I'm new to the LLVM testing infrastructure, so please tell me if there's a better way to do this check.<div>

<br></div><div>Thanks,</div><div><br></div><div>Tom</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 1:16 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 09/12/2013 10:05 PM, Tom Roeder wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Performing the select as a regular instruction (%a = select ...) doesn't<br>
trigger the bug. It has to end up with a CE_SELECT in the CONSTANTS block<br>
of the bitcode file. However, I'm far from an expert in LLVM bitcode, so if<br>
there's a smaller test case, I'd be happy to switch to it.<br>
</blockquote>
<br></div>
Hi Tom,<br>
<br>
just to explain why I even ask for this. Every unneeded code makes me start thinking for some reason it is needed to trigger the test case. So by removing any unneeded code, it is a lot more clear why something happened. As you have seen just know, this was even necessary to make me realize we only work on the constant selects (even though it was in fact clear in the patch);<br>


<br>
What about this test case:<br>
<br>
define <2 x i32> @main() {<br>
 ret <2 x i32> select (<2 x i1> <i1 false, i1 undef>, <2 x i32> <i32 0, i32 0>, <2 x i32> <i32 0, i32 undef>)<br>
}<br>
<br>
Does this still trigger the bug?<br>
<br>
Also it would be nice to add a small comment that this explicitly tests constant expressions.<br>
<br>
Ah, and as said before, it would be nice to check that the very same IR is actually regenerated.<br>
<br>
Cheers,<br>
Tobias<br>
<br>
<br>
</blockquote></div><br></div>