How can I do llvm link time optimization

前端 未结 1 1367
慢半拍i
慢半拍i 2021-01-14 01:39

I compile a C++ program, using for example the following.

clang++ -O4 -emit-llvm file1.cpp -c -o file1.bc 
clang++ -O4 -emit-llvm file2.cpp -c -o file2.bc 

         


        
相关标签:
1条回答
  • 2021-01-14 01:57

    Use opt:

    clang++ -O4 -emit-llvm file1.cpp -c -o file1.bc 
    clang++ -O4 -emit-llvm file2.cpp -c -o file2.bc 
    llvm-link file1.bc file2.bc -o all.bc
    opt -std-compile-opts -std-link-opts -O3 all.bc -o optimized.bc
    
    0 讨论(0)
提交回复
热议问题