Skip to content

Commit fdc309c

Browse files
committed
Add a random .LL file generator to stress-test different llvm components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151479 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a515b4e commit fdc309c

9 files changed

+741
-2
lines changed

docs/CommandGuide/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ <h2>
7575
<li><a href="/cmds/llvm-cov.html"><b>llvm-cov</b></a> -
7676
emit coverage information</li>
7777

78+
<li><a href="/cmds/llvm-stress.html"><b>llvm-stress</b></a> -
79+
generate random .ll files to fuzz different llvm components</li>
80+
7881
</ul>
7982

8083
</div>

docs/CommandGuide/llvm-stress.pod

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
=pod
2+
3+
=head1 NAME
4+
5+
llvm-stress - generate random .ll files
6+
7+
=head1 SYNOPSIS
8+
9+
B<llvm-cov> [-gcno=filename] [-gcda=filename] [dump]
10+
11+
=head1 DESCRIPTION
12+
13+
The B<llvm-stress> tool is used to generate random .ll files that can be used to
14+
test different components of LLVM.
15+
16+
=head1 OPTIONS
17+
18+
=over
19+
20+
=item B<-o> I<filename>
21+
22+
Specify the output filename.
23+
24+
=item B<-size> I<size>
25+
26+
Specify the size of the generated .ll file.
27+
28+
=item B<-seed> I<seed>
29+
30+
Specify the seed to be used for the randomly generated instructions.
31+
32+
=back
33+
34+
=head1 EXIT STATUS
35+
36+
B<llvm-stress> returns 0.
37+
38+
=head1 AUTHOR
39+
40+
B<llvm-stress> is maintained by the LLVM Team (L<http://llvm.org/>).
41+
42+
=cut

docs/ReleaseNotes.html

+26-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ <h3>
357357
closest user-defined super-class.</li>
358358
<li><code>MachineRegisterInfo</code> now allows the reserved registers to be
359359
frozen when register allocation starts. Target hooks should use the
360-
<code>MRI->canReserveReg(FramePtr)</code> method to avoid accidentally
360+
<code>MRI-&gt;canReserveReg(FramePtr)</code> method to avoid accidentally
361361
disabling frame pointer elimination during register allocation.</li>
362362
<li>A new kind of <code>MachineOperand</code> provides a compact
363363
representation of large clobber lists on call instructions. The register
@@ -490,6 +490,31 @@ <h3>
490490

491491
</div>
492492

493+
<!--=========================================================================-->
494+
<h3>
495+
<a name="tools_changes">Tools Changes</a>
496+
</h3>
497+
498+
<div>
499+
500+
<p>In addition, some tools have changed in this release. Some of the changes
501+
are:</p>
502+
503+
504+
<ul>
505+
<li>llvm-stress is a command line tool for generating random .ll files to fuzz
506+
different LLVM components. </li>
507+
<li>....</li>
508+
</ul>
509+
510+
<ul>
511+
<li>....</li>
512+
</ul>
513+
514+
</div>
515+
516+
</div>
517+
493518
<!-- *********************************************************************** -->
494519
<h2>
495520
<a name="knownproblems">Known Problems</a>

tools/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ add_subdirectory(bugpoint)
4444
add_subdirectory(bugpoint-passes)
4545
add_subdirectory(llvm-bcanalyzer)
4646
add_subdirectory(llvm-stub)
47+
add_subdirectory(llvm-stress)
4748

4849
if( NOT WIN32 )
4950
add_subdirectory(lto)

tools/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PARALLEL_DIRS := opt llvm-as llvm-dis \
3434
bugpoint llvm-bcanalyzer llvm-stub \
3535
llvm-diff macho-dump llvm-objdump \
3636
llvm-rtdyld llvm-dwarfdump llvm-cov \
37-
llvm-size
37+
llvm-size llvm-stress
3838

3939
# Let users override the set of tools to build from the command line.
4040
ifdef ONLY_TOOLS

tools/llvm-stress/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo)
2+
3+
add_llvm_tool(llvm-stress
4+
llvm-stress.cpp
5+
)

tools/llvm-stress/LLVMBuild.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
;===- ./tools/llvm-stress/LLVMBuild.txt -------------------------*- Conf -*--===;
2+
;
3+
; The LLVM Compiler Infrastructure
4+
;
5+
; This file is distributed under the University of Illinois Open Source
6+
; License. See LICENSE.TXT for details.
7+
;
8+
;===------------------------------------------------------------------------===;
9+
;
10+
; This is an LLVMBuild description file for the components in this subdirectory.
11+
;
12+
; For more information on the LLVMBuild system, please see:
13+
;
14+
; http://llvm.org/docs/LLVMBuild.html
15+
;
16+
;===------------------------------------------------------------------------===;
17+
18+
[component_0]
19+
type = Tool
20+
name = llvm-stress
21+
parent = Tools
22+
required_libraries = AsmParser BitReader BitWriter IPO Instrumentation Scalar

tools/llvm-stress/Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##===- tools/llvm-stress/Makefile --------------------------*- Makefile -*-===##
2+
#
3+
# The LLVM Compiler Infrastructure
4+
#
5+
# This file is distributed under the University of Illinois Open Source
6+
# License. See LICENSE.TXT for details.
7+
#
8+
##===----------------------------------------------------------------------===##
9+
10+
LEVEL := ../..
11+
TOOLNAME := llvm-stress
12+
LINK_COMPONENTS := object
13+
LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo
14+
15+
# This tool has no plugins, optimize startup time.
16+
TOOL_NO_EXPORTS = 1
17+
18+
include $(LEVEL)/Makefile.common

0 commit comments

Comments
 (0)