netra at cse.iitb.ac.in
2011-Apr-16 03:15 UTC
[LLVMdev] [Fwd: Re: [Fwd: Regarding Inter Procedural Constant Propagation]]
Hi, I used the following commands on the program attached below: llvm-gcc --emit-llvm main.c -c -o main.bc opt -ipconstprop main.bc -o main1.bc diff main.bc main1.bc no difference was o/p :( The Program Segment is as shown below: #include <stdio.h> void f1(int a) { a=a+1; printf("%d",a); } void f2() { int b; b=1; f1(b); } int main() { int a=1; f2(); f1(a); } Also,when i use the following command: opt -print-after-all main.bc The dumps generated dont include IPCP or Intraprocedural Const Propagation dumps.Why so? Is there any other way to see the effect of a pass on the i/p bitcode file? Kindly let me know where i am going wrong. Netra,>> ---------------------------- Original Message ---------------------------- >> Subject: Regarding Inter Procedural Constant Propagation >> From: netra at cse.iitb.ac.in<mailto:netra at cse.iitb.ac.in> >> Date: Wed, April 13, 2011 1:29 am >> To: llvmdev at cs.illinois.edu<mailto:llvmdev at cs.illinois.edu> >> -------------------------------------------------------------------------- >> >> Hi, >> I want to see the output of a InterProcedural Constant Propagation Pass >> IPCP in llvm. >> I have llvm 2.8 installed.And i used opt -print-after-all command to see >> the .bc output generated after each pass. >> However,this does not include dump produced by IPCP :( why? >> Kindly tell me how to view dump produced by IPCP. >> >> P.S: i have tried opt -ipcp src.bc -o src1.bc >> However the src.bc and src1.bc both files r identical. :( >> >> Kindly help me regarding this. >> >> Regards, >> Netra >>Regards, Netra
Duncan Sands
2011-Apr-25 08:55 UTC
[LLVMdev] [Fwd: Re: [Fwd: Regarding Inter Procedural Constant Propagation]]
Hi Netra,> I used the following commands on the program attached below: > > llvm-gcc --emit-llvm main.c -c -o main.bc > opt -ipconstprop main.bc -o main1.bcalmost all LLVM optimization passes work poorly if you haven't run the mem2reg pass first, so try at least opt -mem2reg -ipconstprop main.bc -o main1.bc> Also,when i use the following command: > opt -print-after-all main.bc > > The dumps generated dont include IPCP or Intraprocedural Const Propagation > dumps.Why so?Because you didn't tell opt to run that pass. Ciao, Duncan.
Maybe Matching Threads
- [LLVMdev] Regarding Inter Procedural Constant Propagation
- status of IPO/IPCP?
- status of IPO/IPCP?
- IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?
- IRMover asserts "mapping to a source type" when repeatedly linking - usage or LLVM bug?