[LLVMdev] Is "clang -O1" the same as "clang -O0 + opt -O1"?

Hal Finkel hfinkel at anl.gov
Sun Feb 8 18:41:23 PST 2015


Hi,

No, it's not. Try:
  clang -O1 -mllvm -disable-llvm-optzns -S -emit-llvm

to get the IR, as it would appear to the optimizer, but without running the optimizer itself as part of the clang invocation.

 -Hal

----- Original Message -----
> From: "Yi-Hong Lyu" <b95705030 at ntu.edu.tw>
> To: llvmdev at cs.uiuc.edu
> Sent: Sunday, February 8, 2015 8:32:32 PM
> Subject: [LLVMdev] Is "clang -O1" the same as "clang -O0 + opt -O1"?
> 
> 
> 
> Hello,
> 
> I encounter a bug that pumped during execution of "clang -O1".
> However the bug cannot be reproduced by using "clang -O0 + opt -O1".
> It seems that "clang -O1" is not the same as "clang -O0 + opt -O1".
> According to the generated LLVM IRs are large, I would like to use
> bugpoint with "clang -O1" directly instead of using "clang -O0"
> first and using bugpoint with "opt -O1". Could you tell me how I can
> do this?
> 
> Any suggestion is welcomed.
> 
> Thanks
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list