[llvm-commits] CVS: llvm-www/demo/DemoInfo.html index.cgi

anon at cs.uiuc.edu anon at cs.uiuc.edu
Thu Jun 4 05:28:28 PDT 2009



Changes in directory llvm-www/demo:

DemoInfo.html updated: 1.2 -> 1.3
index.cgi updated: 1.100 -> 1.101
---
Log message:

Turn on nested function support for C.
Add an option to turn off optimization.
Boost the optimization level to -O3 when
optimizing.


---
Diffs of the changes:  (+42 -14)

 DemoInfo.html |   24 +++++++++++++++++++-----
 index.cgi     |   32 +++++++++++++++++++++++---------
 2 files changed, 42 insertions(+), 14 deletions(-)


Index: llvm-www/demo/DemoInfo.html
diff -u llvm-www/demo/DemoInfo.html:1.2 llvm-www/demo/DemoInfo.html:1.3
--- llvm-www/demo/DemoInfo.html:1.2	Mon Oct  1 17:44:25 2007
+++ llvm-www/demo/DemoInfo.html	Thu Jun  4 07:25:31 2009
@@ -39,19 +39,33 @@
 be easier to understand.
 </p>
 
-<h2><a name="lto">Run link-time optimizer</a></h2>
+<h2><a name="optlevel">Optimization level</a></h2>
 
 <p>
+<dl>
+
+  <dt><tt><b>Standard</b></tt>: </dt>
+<dd>
+Select this option to run a standard set of LLVM optimizations.
+</dd>
+
+  <dt><tt><b>LTO</b></tt>: </dt>
+<dd>
 Select this option to run the LLVM link-time optimizer, which is designed to
 optimize across files in your application.  Since the demo page doesn't allow
 you to upload multiple files at once, and does not link in any libraries, we
 configured the demo page optimizer to assume there are no calls 
 coming in from outside the source file, allowing it to optimize more 
-aggressively.</p>
-
-<p>Note that you have to define 'main' in your program for this 
+aggressively.
+Note that you have to define 'main' in your program for this 
 to make much of a difference.
-</p>
+</dd>
+
+  <dt><tt><b>None</b></tt>: </dt>
+<dd>
+Select this option to turn off all optimizations.
+</dd>
+</dl>
 
 <h2><a name="stats">Show detailed pass statistics</a></h2>
 


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.100 llvm-www/demo/index.cgi:1.101
--- llvm-www/demo/index.cgi:1.100	Tue Jun  2 09:59:04 2009
+++ llvm-www/demo/index.cgi	Thu Jun  4 07:25:32 2009
@@ -193,11 +193,12 @@
     -default => 'C'
   ), "<p>";
 
-print $c->checkbox(
-    -name  => 'linkopt',
-    -label => 'Run link-time optimizer',
-    -checked => 'checked'
-  ),' <a href="DemoInfo.html#lto">?</a><br>';
+print "Optimization level: ",
+  $c->radio_group(
+    -name    => 'optlevel',
+    -values  => [ 'Standard', 'LTO', 'None' ],
+    -default => 'Standard'
+  ),' <a href="DemoInfo.html#optlevel">?</a><br>', "<p>";
 
 print $c->checkbox(
     -name  => 'showstats',
@@ -310,6 +311,15 @@
     '.f'    => 'Fortran',
     '.f90'  => 'Fortran'
 );
+my %language_options = (
+    'Java'             => '',
+    'JO99'             => '',
+    'C'                => '-fnested-functions',
+    'C++'              => '',
+    'Fortran'          => '',
+    'preprocessed C'   => '-fnested-functions',
+    'preprocessed C++' => ''
+);
 
 my $uploaded_file_name = $c->param('uploaded_file');
 if ($uploaded_file_name) {
@@ -356,8 +366,12 @@
     #$stats = "-Wa,--stats,--time-passes,--info-output-file=$timerFile"
     $stats = "-ftime-report"
 	if ( $c->param('showstats') );
+
+    my $options = $language_options{ $c->param('language') };
+    $options .= " -O3" if $c->param('optlevel') ne "None";
+
     try_run( "llvm C/C++/Fortran front-end (llvm-gcc)",
-	"llvm-gcc -emit-llvm -msse3 -W -Wall -O2 $stats -o $bytecodeFile -c $inputFile > $outputFile 2>&1",
+	"llvm-gcc -emit-llvm -msse3 -W -Wall $options $stats -o $bytecodeFile -c $inputFile > $outputFile 2>&1",
       $outputFile );
 
     if ( $c->param('showstats') && -s $timerFile ) {
@@ -366,7 +380,7 @@
         print "$HtmlResult\n";
     }
 
-    if ( $c->param('linkopt') ) {
+    if ( $c->param('optlevel') eq 'LTO' ) {
         my $stats      = '';
         my $outputFile = getname(".gccld.out");
         my $timerFile  = getname(".gccld.time");
@@ -440,8 +454,8 @@
         "--- Query: ---\nFrom: ($ip) $host\nInput: $lines lines of $lg\n"
           . "C++ demangle = "
           . ( $c->param('cxxdemangle') ? 1 : 0 )
-          . ", Link opt = "
-          . ( $c->param('linkopt') ? 1 : 0 ) . "\n\n"
+          . ", Opt level = "
+          . ( $c->param('optlevel') ) . "\n\n"
           . ", Show stats = "
           . ( $c->param('showstats') ? 1 : 0 ) . "\n\n"
           . "--- Source: ---\n$source\n"






More information about the llvm-commits mailing list