[cfe-dev] How long should a compile of a single C file with a vast number of macros take?

Quentin Colombet qcolombet at apple.com
Wed Jan 29 11:18:42 PST 2014


Hi Oliver,

There are several things you can do to at least isolate which part of the compiler is at “fault”.
1. Try to compile with -E to produce the preprocess file.
2. Try to compile the preprocess file with -O0 -emit-llvm -S -o file.ll to produce the llvm-ir.
3. Try to compile the llvm-ir file with opt with your optimization level to see if it is the high level optimizations passes. (e.g., opt -O3 file.ll -S -o after_opt.ll).
4. Try to compile the produced after_opt.ll with llc to see if it is a low-level optimization problem, e.g. llc after_opt.ll -o out.s -O3.

Hopefully, one of this step will take a lot of time and will be the faulty part.
When you have that, filing a bug would be the right thing to do. 

Thanks,
-Quentin

On Jan 29, 2014, at 11:00 AM, Oliver Schneider <oliver at f-prot.com> wrote:

> A colleague of mine wrote some test cases in a single huge C file with a
> lot of macros.
> 
> GCC takes a few seconds to compile the file, but Clang takes apparently
> more than 10 minutes - I canceled it at that point.
> 
> How can I track down the problem? I guess C-Reduce won't cut it this
> time, because it's a performance problem.
> 
> Thanks,
> 
> // Oliver
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140129/4dceaa7d/attachment.html>


More information about the cfe-dev mailing list