<div dir="ltr">I filed a shorter version of the i7 example here:<br><a href="https://llvm.org/bugs/show_bug.cgi?id=27825">https://llvm.org/bugs/show_bug.cgi?id=27825</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 11:37 PM, Pete Cooper via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I was curious about this for integers. Looks like we have at least one bug which is of a similar vein. Comment out the branch here and the test will pass on x86, otherwise it fails.<div><br></div><div>Note, command line I used was: llc int.ll -o int.s --filetype=asm && clang++ int.s -o main && ./main; echo $?<br><div><br></div><div>@g = constant i8 255<br>define i32 @main() {<br> %ptr = bitcast i8* @g to i7*<br> %v7 = load i7, i7* %ptr<br>; br label %cmp<br>; cmp:<br> %add7 = add i7 %v7, 1<br> %icmp = icmp eq i7 %add7, 0<br> br i1 %icmp, label %eq, label %ne<br>eq:<br> ret i32 0<br>ne:<br> ret i32 1<br>}<br><div><br></div><div>Pete</div><div><div><blockquote type="cite"><div>On May 4, 2016, at 6:04 PM, via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div style="word-wrap:break-word">DAG legalization still runs with -O0.<div><br></div><div>—escha</div><div><br><div><blockquote type="cite"><div>On May 4, 2016, at 6:00 PM, Carlos Liam <<a href="mailto:carlos@aarzee.me" target="_blank">carlos@aarzee.me</a>> wrote:</div><br><div><div style="word-wrap:break-word">Shouldn't that not happen when I run with -O0?<br><div>
<br><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> - CL</span>
</div>
<br><div><blockquote type="cite"><div>On May 4, 2016, at 8:56 PM, <a href="mailto:escha@apple.com" target="_blank">escha@apple.com</a> wrote:</div><br><div><div style="word-wrap:break-word">I checked the debug log: this is what’s happening.<div><br></div><div>1. Because f16 isn’t legal, SINT_TO_FP and FP_TO_SINT get promoted to f32.</div><div>2. f32 has 24 mantissa bits, which is enough to losslessly represent i16s. So the conversion gets eliminated in <span style="font-family:Menlo;font-size:11px">FoldIntToFPToInt.</span></div><div><br></div><div>Part 1) here looks fairly suspicious.</div><div><br></div><div>—escha</div><div><br><div><blockquote type="cite"><div>On May 4, 2016, at 5:41 PM, John Criswell via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div>
<div bgcolor="#FFFFFF" text="#000000">
<div>On 5/4/16 8:25 PM, Carlos Liam via
llvm-dev wrote:<br>
</div>
<blockquote type="cite">
I have IR at <a href="https://ghostbin.com/paste/daxv5" target="_blank">https://ghostbin.com/paste/daxv5</a> which
is meant to exit 1, but it is always exiting 0.
<div><br>
</div>
</blockquote>
<br>
1) It would help if you pasted the relevant code into your message.
Paranoid people like me don't following links in emails.<br>
<br>
2) Have you ensured that your program doesn't exercise undefined
behavior? If your program has a signed overflow, an out-of-bounds
error, or some other undefined behavior, the compiler may optimize
it in surprising and unexpected way.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote type="cite">
<div>I'm using it as a template for checking if two
functions @test1 and @test2 are equivalent by checking against
the exhaustive possible i16 values. For this particular example
it should be enough to know that for certain i16, @test1 and
@test2 are *not* equal. When an inequality is found, the program
should exit 1. However, it seems like it's always exiting 0. Is
there something I'm doing wrong?<br>
<div>
<br>
<span> - CL</span>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
</div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>