Wow, nifty tool! I've already found a couple crashes!<div><br></div><div>It is also really easy to pinpoint what is causing the error. Whenever you trigger a bug, run llvm-stress with the same seed but a really small size that doesn't trigger the bug (e.g. like 10). Then do binary search on the size. Eventually you find exactly the cutoff of size that triggers the bug (e.g. 539 runs fine, but 540 crashes), and then you can diff the crashing and non-crashing .ll files and there should only be a tiny difference.</div>
<div><br></div><div>--Sean Silva<br><br><div class="gmail_quote">On Sun, Feb 26, 2012 at 7:29 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nadav,<br>
<br>
Thanks, this is neat! Here is a patch which optionally enables<br>
generation of the other floating-point types. Please review.<br>
<br>
-Hal<br>
<div class="HOEnZb"><div class="h5"><br>
On Sun, 26 Feb 2012 11:51:04 +0000<br>
"Rotem, Nadav" <<a href="mailto:nadav.rotem@intel.com">nadav.rotem@intel.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> Compiling lots of 'junk' helps in catching bugs. I added a new tool<br>
> (located under llvm/tools/llvm-stress) for generating random LL<br>
> files. The tool can be used to test different llvm components using<br>
> various compilation flags. Until now, I only found bugs in the<br>
> codegen, and not in general llvm optimizations. This probably means<br>
> that the generated tests are currently too simple for the<br>
> higher-level optimizations.<br>
><br>
> The command line below generates a random ll file, and llc compiles<br>
> this file. It often crashes.<br>
><br>
> ./llvm-stress -seed $RANDOM -o tmp.ll -size 1000 ; ./llc tmp.ll<br>
> -mcpu=corei7-avx -mattr=+avx -o /dev/null<br>
><br>
> The "-seed" flag sets the initial seed to be used by the random<br>
> function. I implemented a simple portable 'random' function so that<br>
> the result should be identical on all platforms. The initial seed<br>
> also appears in the name of the generated function. The "-size"<br>
> parameter sets the size of the generated random file.<br>
><br>
> Nadav<br>
> ---------------------------------------------------------------------<br>
> Intel Israel (74) Limited<br>
><br>
> This e-mail and any attachments may contain confidential material for<br>
> the sole use of the intended recipient(s). Any review or distribution<br>
> by others is strictly prohibited. If you are not the intended<br>
> recipient, please contact the sender and delete all copies.<br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Hal Finkel<br>
Postdoctoral Appointee<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>