Hello, I am trying to understand the opt tool. I wrote a program and created the .bc file using clang. And I used this .bc file to generate another .bc file using the opt tool. I dis-assembled this bitcode file and compared the output with previous unoptimized bitcode file. It was the same. I am not sure how to check the difference. Can anyone tell me if this is how we check the optimized output or is there any other way. If the procedure that I used is correct then could you tell me why am I not able to see the optimizations on the source code. The commands are in this way: clang -c -emit-llvm filename.c -o filename.bc opt -strip-dead-prototypes -f <filename.bc> filename2.bc I am working on the visual studio solution file and on windows 7 (in case you want to know the platform) Thanks. -- Kalyan Ponnala phone: 8163772059 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100416/519a8b41/attachment.html>
Hi Kalyan,> opt -strip-dead-prototypes -f <filename.bc> filename2.bcyou have to specify the list of passes to run. -strip-dead-prototypes only removes unused declarations. If there are none, it will do nothing. Try: opt -std-compile-opts -f <filename.bc> filename2.bc Ciao, Duncan.
Hello Kalyan, There is one more thing you should know: Clang has maximum optimization turned on by default. You need to specify -O0 to turn it off if you want to see what opt does without clang running all of the optimizations first. --Sam ----- Original Message ----> From: Duncan Sands <baldrick at free.fr> > To: llvmdev at cs.uiuc.edu > Sent: Sat, April 17, 2010 2:00:00 AM > Subject: Re: [LLVMdev] understanding the opt tool > > Hi Kalyan,> opt -strip-dead-prototypes -f <filename.bc> > filename2.bcyou have to specify the list of passes to run.> -strip-dead-prototypesonly removes unused declarations. If there are> none, it will do nothing.Try: opt -std-compile-opts -f> <filename.bc> > filename2.bcCiao, Duncan. _______________________________________________ LLVM> Developers mailing list> href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu > > http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev