[AVX] Add some utilities to insert and extract 128-bit subvectors.
[oota-llvm.git] / utils / profile.pl
index 20810fab9a0964f15e8ebf60272d4f15cdaed7d6..318011560bc8ee94961548e599ce54030c6d05c5 100755 (executable)
@@ -5,7 +5,7 @@
 # Synopsis: Insert instrumentation code into a program, run it with the JIT,
 #           then print out a profile report.
 #
-# Syntax:   profile.pl [OPTIONS] bytecodefile <arguments>
+# Syntax:   profile.pl [OPTIONS] bitcodefile <arguments>
 #
 # OPTIONS may include one or more of the following:
 #     -block    - Enable basicblock profiling
@@ -56,17 +56,16 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
   $LLVMProfOpts .= " " . $_;
 }
 
-die "Must specify LLVM bytecode file as first argument!" if (@ARGV == 0);
+die "Must specify LLVM bitcode file as first argument!" if (@ARGV == 0);
 
 my $BytecodeFile = $ARGV[0];
 
 shift @ARGV;
 
-my $LLIPath = `which lli`;
-$LLIPath = `dirname $LLIPath`;
-chomp $LLIPath;
+my $libdir = `llvm-config --libdir`;
+chomp $libdir;
 
-my $LibProfPath = $LLIPath . "/../../lib/Debug/libprofile_rt.so";
+my $LibProfPath = $libdir . "/profile_rt.so";
 
 system "opt -q -f $ProfilePass $BytecodeFile -o $BytecodeFile.inst";
 system "lli -fake-argv0 '$BytecodeFile' -load $LibProfPath " .