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

71 views
Skip to first unread message

Yi-Hong Lyu

unread,
Feb 8, 2015, 9:36:45 PM2/8/15
to llv...@cs.uiuc.edu
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

Hal Finkel

unread,
Feb 8, 2015, 9:44:13 PM2/8/15
to Yi-Hong Lyu, llv...@cs.uiuc.edu
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
> _______________________________________________
> LLVM Developers mailing list
> LLV...@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
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Yi-Hong Lyu

unread,
Feb 9, 2015, 11:44:27 AM2/9/15
to Hal Finkel, llv...@cs.uiuc.edu
Hello Hal,

Thansk for your reply. It seems that clang -O1 -mllvm -disable-llvm-optzns is the same as "clang -O0 -mllvm -disable-llvm-optzns", right? Please tell me if I have mistake.

Although I use "clang -O0 -mllvm -disable-llvm-optzns + opt -O1", the bug is still not reproduced. I use "mllvm -debug" to dump the pass manager's arguments. It seems that the LLVM passes order is different between "clang -O0 -mllvm -disable-llvm-optzns + opt -O1" and "clang -O1". The bug seems only occur when I am using "clang -O1". Is there any way to use bugpoint with clang (embedded bugpoint into clang)?

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages