similar to: [LLVMdev] Optimization application by llvm-gcc, opt

Displaying 20 results from an estimated 60000 matches similar to: "[LLVMdev] Optimization application by llvm-gcc, opt"

2011 Dec 13
0
[LLVMdev] Optimization application by llvm-gcc, opt
Hi RaghuB, > I wanted to clarify something about the application of optimizations by llvm-gcc, opt and llc. > > Will the following two sequences generate the same optimized bitcode? > a) $ llvm-gcc -O3 -c -emit-llvm foo.c -o foo.bc > b) $ llvm-gcc -O0 -c -emit-llvm foo.c -o foo.bc > $ opt -O3 foo.bc not necessarily, though usually it is the same. One reason for
2011 Dec 13
2
[LLVMdev] Optimization application by llvm-gcc, opt
Thanks Duncan. Just to make sure I understand correctly, opt has more global information, due to which optimizations can have greater effect than in llvm-gcc, where optimizations are applied on a per-function basis. Is this correct ? ----- Original Message ----- From: "Duncan Sands" <baldrick at free.fr> To: llvmdev at cs.uiuc.edu Sent: Tuesday, December 13, 2011 2:46:23 AM
2011 Dec 13
0
[LLVMdev] Optimization application by llvm-gcc, opt
Hi Raghu, > Thanks Duncan. Just to make sure I understand correctly, opt has more global information, due to which optimizations can have greater effect than in llvm-gcc, where optimizations are applied on a per-function basis. Is this correct ? if you look carefully at what "opt -O3" runs (using -debug-pass=Arguments) you will see that it first runs a small list of passes (the
2010 Sep 17
3
[LLVMdev] Query on llvm-gcc v/s llc/as
Hi all, I have started using LLVM recently, and I have a basic question. There are two different ways in which an executable can be generated from a .c file - by just using llvm-gcc, and using a combination of llvm-gcc (to emit bitcode .bc), llc (to emit assembly code), as (to assemble the code) and collect2 (linker). For example, consider compiling test.c : 1) llvm-gcc -O3 test.c -o
2007 Dec 07
3
[LLVMdev] Reproducing output of llvm-gcc using opt tool
Hi, Recently, I was looking into the bug #1227. I wanted to check if reordering optimization passes could solve it. To start with, I tried to reproduce the output of llvm-g++ -O3 using the combination of llvm-g++ -O0 and opt with the appropriate passes. However, I was unable to. I use SVN versions of llvm and llvm-gcc-4.2. First, I compile example.cpp (attached; taken from the bug #1227) with: $
2020 Jul 02
2
flags to reproduce clang -O3 with opt -O3
Hello, I've been trying to figure out how to reproduce the results of a single clang -O3 compilation to a binary with a multi-step process using opt. Specifically I have: clang -O3 foo.c -o foo.exe which I want to replicate with: clang -O0 -c -emit-llvm foo.c opt -O3 foo.bc -o foo_o.bc clang foo_o.bc -o foo.exe Any hints / suggestions on what additional flags I need to produce the same
2020 Jul 03
2
flags to reproduce clang -O3 with opt -O3
Awesome, thanks! I'd like to have the last step (llc in your example) not perform additional optimization passes, such as O3, and simply use the O3 pass from opt in the previous line. Do you happen to know if I should use 'llc -O0 foo_o.bc -o foo.exe' instead to achieve this? On Thu, Jul 2, 2020 at 6:35 PM Mehdi AMINI <joker.eph at gmail.com> wrote: > > > On Thu,
2018 Jan 05
2
Relationship between clang, opt and llc
If you pass -O0 to clang, most functions will be tagged with an optnone function attribute that will prevent opt and llc even if you pass -O3 to opt and llc. This is the mostly likely cause for the slow down in 2. You can disable the optnone function attribute behavior by passing "-Xclang -disable-O0-optnone" to clang ~Craig On Fri, Jan 5, 2018 at 1:19 PM, toddy wang via llvm-dev <
2018 Jan 06
0
Relationship between clang, opt and llc
-disable-O0-optnone has no effect with anything other than -O0. -O0 being passed to clang also causes all functions to be marked noinline. I don't know if there is a command line option to turn that off. I recommend passing "-O1 -Xclang -disable-llvm-passes" to clang. Passing -O0 very specifically means disable optimizations. ~Craig On Sat, Jan 6, 2018 at 12:25 PM, toddy wang
2018 Jan 06
2
Relationship between clang, opt and llc
@Craig and @Michael After installing clang-5.0 (download from http://releases.llvm.org, does not have Flang build's slowdown mention above), 1. clang++ -O0 -Xclang -disable-O0-optnone -Xclang -disable-llvm-passes -c -emit-llvm -o a.bc LULESH.cc; opt -O3 a.bc -o b.bc; llc -O3 -filetype=obj b.bc -o b.o ; clang++ b.o -o b.out; ./b.out 20 runtime: 2.354069e+01 2. clang++ -O1 -Xclang
2018 Jan 06
0
Relationship between clang, opt and llc
@Zhaopei, thanks for the clarification. @Craig and @Michael, for clang 4.0.1, -Xclang -disable-O0-optnone gives the following error message. From which version -disable-O0-optnone gets supported? [twang15 at c89 temp]$ clang++ -O0 -Xclang -disable-O0-optnone -Xclang -disable-llvm-passes -c -emit-llvm -o a.bc LULESH.cc error: unknown argument: '-disable-O0-optnone' [twang15 at c89
2018 Jan 05
0
Relationship between clang, opt and llc
I tried the following on LULESH1.0 serial version ( https://codesign.llnl.gov/lulesh/LULESH.cc) 1. clang++ -O3 LULESH.cc; ./a.out 20 Runtime: 9.487353 second 2. clang++ -O0 -Xclang -disable-llvm-passes -c -emit-llvm -o a.bc LULESH.cc; opt -O3 a.bc -o b.bc; llc -O3 -filetype=obj b.bc -o b.o ; clang++ b.o -o b.out; ./b.out 20 Runtime: 24.15 seconds 3. clang++ -O3 -Xclang -disable-llvm-passes -c
2018 Jan 06
0
Relationship between clang, opt and llc
Why are you using build directions from "flang" which is a fortran compiler and maintained by different people than the LLVM/clang community? But then compiling C/C++ code? Their bug database should be used for filing bugs against the fortran compiler not a C/C++ compiler issue. ~Craig On Sat, Jan 6, 2018 at 1:04 PM, toddy wang <wenwangtoddy at gmail.com> wrote: > Thanks a
2018 Jan 06
0
Relationship between clang, opt and llc
What I am trying is to compile a program with different sets of optimization flags. If there is no fine-grained control over clang optimization flags, it would be impossible to achieve what I intend. Although there is fine-grained control via opt, for a large-scale projects, clang-opt-llc pipeline may not be a drop-in solution. On Fri, Jan 5, 2018 at 10:00 PM, Craig Topper <craig.topper at
2017 Apr 11
3
Relationship between clang, opt and llc
It's really nice of you pointing out the -Xclang option, it makes things much easier. I really appreciate your help! Best, Peizhao On Mon, Apr 10, 2017 at 10:12 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: > > On Apr 10, 2017, at 5:21 PM, Craig Topper via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > clang -O0 does not disable all optimization passes
2018 Jan 06
2
Relationship between clang, opt and llc
Thanks a lot, it is clear to me now. BTW, for Clang's slowdown, I submit an issue here: https://github.com/flang-compiler/flang/issues/356 I have no idea about the root cause. Maybe due to debug symbols. But, I already use -DCMAKE_BUILD_TYPE=Release. Anyway, I believe there is a bug somewhere. On Sat, Jan 6, 2018 at 3:43 PM, Craig Topper <craig.topper at gmail.com> wrote: >
2018 Jan 06
3
Relationship between clang, opt and llc
I don't think "clang -help" prints options about optimizations. Clang itself doesn't have direct support for fine grained optimization control. Just the flag for levels -O0/-O1/-O2/-O3. This is intended to be simple and sufficient interface for most users who just want to compile their code. So I don't think there's a way to pass just -dse to clang. opt on the other hand
2018 Jan 06
0
Relationship between clang, opt and llc
Craig, thanks a lot! I'm actually confused by clang optimization flags. If I run clang -help, it will show many optimizations (denoted as set A) and non-optimization options (denoted as set B). If I run llvm-as < /dev/null | opt -O0/1/2/3 -disable-output -debug-pass=Arguments, it also shows many optimization flags (denote as set C). There are many options in set C while not in set A,
2018 Jan 06
1
Relationship between clang, opt and llc
After build LLVM5.0, I found that clang-5.0 is extremely slow. Even it is built with -DCMAKE_BUILD_TYPE=Release For building LULESH.cc, it gets stucked at linkage stage. I build it as instructed from here https://github.com/flang-compiler/flang Maybe I should submit a bug. On Fri, Jan 5, 2018 at 8:41 PM, toddy wang <wenwangtoddy at gmail.com> wrote: > Craig, thanks a lot! > >
2018 Jan 06
4
Relationship between clang, opt and llc
O0 didn't start applying optnone until r304127 in May 2017 which is after the 4.0 family was branched. So only 5.0, 6.0, and trunk have that behavior. Commit message copied below Author: Mehdi Amini <joker.eph at gmail.com> Date: Mon May 29 05:38:20 2017 +0000 IRGen: Add optnone attribute on function during O0 Amongst other, this will help LTO to correctly handle/honor