[all-commits] [llvm/llvm-project] fb07af: [BPF] Avoid potential long compilation time withou...

yonghong-song via All-commits all-commits at lists.llvm.org
Tue Jun 25 09:27:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb07afedbebb0c9f2647d02c6f254245cdb84085
      https://github.com/llvm/llvm-project/commit/fb07afedbebb0c9f2647d02c6f254245cdb84085
  Author: yonghong-song <yhs at fb.com>
  Date:   2024-06-25 (Tue, 25 Jun 2024)

  Changed paths:
    M llvm/lib/Target/BPF/BPFRegisterInfo.cpp

  Log Message:
  -----------
  [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 at linux.dev>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list