aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authoryonghong-song <yhs@fb.com>2024-06-25 09:27:18 -0700
committerGitHub <noreply@github.com>2024-06-25 09:27:18 -0700
commitfb07afedbebb0c9f2647d02c6f254245cdb84085 (patch)
tree5616c76d3835bba04c125e0d995322d34c75b2a5 /flang/lib/Frontend/CompilerInvocation.cpp
parentdca49d739de07b1755ad65aa26dacd2e2c22af20 (diff)
downloadllvm-fb07afedbebb0c9f2647d02c6f254245cdb84085.zip
llvm-fb07afedbebb0c9f2647d02c6f254245cdb84085.tar.gz
llvm-fb07afedbebb0c9f2647d02c6f254245cdb84085.tar.bz2
[BPF] Avoid potential long compilation time without -g (#96575)
Alastair Robertson reported a huge compilation time increase without -g for bpf target when comparing to x86 ([1]). In my setup, with '-O0', for x86, a large basic block compilation takes 0.19s while bpf target takes 2.46s. The top function which contributes to the compile time is eliminateFrameIndex(). Such long compilation time without -g is caused by commit 05de2e481811 ("[bpf] error when BPF stack size exceeds 512 bytes") The compiler tries to get some debug loc by iterating all insns in the basic block which will be used when compiler warns larger-than-512 stack size. Even without -g, such iterating also happens which cause unnecessary compile time increase. To fix the issue, let us move the related code when the compiler is about to warn stack limit violation. This fixed the compile time regression, and on my system, the compile time is reduced from 2.46s to 0.35s. [1] https://github.com/bpftrace/bpftrace/issues/3257 Co-authored-by: Yonghong Song <yonghong.song@linux.dev>
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions