Rob Stewart
2015-Feb-18 16:58 UTC
[LLVMdev] -stats prints nothing, though something is expected
Given the program: int sum(int i,int j) { return i+j; } int main() { sum(3,2); } $ clang -S -emit-llvm foo.c Now I'd like to print all statistics. Unfortunately, the following prints nothing: $ opt -S -O3 -stats < foo.ll > /dev/null However, running the following prints an IR that is different to the contents of foo.ll: $ opt -S -O3 foo.ll I'm using LLVM 3.5. I'm doing something very obviously wrong. What is it? -- Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150218/d78731f6/attachment.html>
Philip Reames
2015-Feb-18 22:11 UTC
[LLVMdev] -stats prints nothing, though something is expected
You are mostly likely using a Release build. -stats only does anything with Assertions enabled. On 02/18/2015 08:58 AM, Rob Stewart wrote:> Given the program: > > int sum(int i,int j) > { return i+j; } > > int main() > { sum(3,2); } > > $ clang -S -emit-llvm foo.c > > Now I'd like to print all statistics. Unfortunately, the following > prints nothing: > > $ opt -S -O3 -stats < foo.ll > /dev/null > > However, running the following prints an IR that is different to the > contents of foo.ll: > > $ opt -S -O3 foo.ll > > I'm using LLVM 3.5. I'm doing something very obviously wrong. What is it? > > -- > Rob > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150218/b8917cb5/attachment.html>
Rob Stewart
2015-Feb-19 15:00 UTC
[LLVMdev] -stats prints nothing, though something is expected
Hi Philip, On Wed Feb 18 2015 at 10:11:32 PM Philip Reames <listmail at philipreames.com> wrote:> You are mostly likely using a Release build. -stats only does anything > with Assertions enabled. >So to use the -stats flag, I must compile LLVM and clang from source, with --enable-assertions ? That seems quite drastic just to see the printout of statistics for each pass applied on my IR. -- Rob> > On 02/18/2015 08:58 AM, Rob Stewart wrote: > > Given the program: > > int sum(int i,int j) > { return i+j; } > > int main() > { sum(3,2); } > > $ clang -S -emit-llvm foo.c > > Now I'd like to print all statistics. Unfortunately, the following > prints nothing: > > $ opt -S -O3 -stats < foo.ll > /dev/null > > However, running the following prints an IR that is different to the > contents of foo.ll: > > $ opt -S -O3 foo.ll > > I'm using LLVM 3.5. I'm doing something very obviously wrong. What is it? > > -- > Rob > > > _______________________________________________ > LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150219/8596ea3c/attachment.html>