1. Mar 23, 2023
    • Yonghong Song's avatar
      [BPF] Improve pruning to avoid generate more types in BTF · a824efcd
      Yonghong Song authored
      Commit 3671bdbc("[BPF] Fix a BTF type pruning bug") fixed a
      pruning bug to allow generate more types. But the commit has a bug
      which permits to generate more types than necessary. The following
      is an example to illustrate the problem.
      
         struct t1 {
           int a;
         };
         struct t2 {
           struct t1 *p1;
           struct t1 *p2;
           int b;
         };
         int foo(struct t2 *arg) {
           return arg->b;
         }
      
      The following is the part of BTF generation sequence:
        (1). 'struct t2 *arg' -> 'struct t1 *p1'
             In this step, the type 'struct t1' will be generated as
             a forward decl and the ptr type (to 'struct t1') will
             be stored in the internal type table.
        (2). now the second field 'struct t1 *p2' will be processed.
             Since the ptr type (to 'struct t1') already in the type
             table, the existing logic strips out ptr modifier and
             is able to generate BTF type for 'struct t1'.
      
      In the above step (2), if CheckPointer is true (the type traversal
      chain including a struct member), 'ptr' modifier should be checked
      and the subsequent type generation should be skipped since
      the same case has been processed in visitDerivedType().
      
      The issue is exposed when I am trying to use llvm15 to compile
      some internal bpf programs. The bpf skeleton put the whole
      ELF section (after striping some sections like dwarf) as a string.
      The large BTF section triggered the following error:
      
        bpf_object_with_struct_ops_test_prog_bpf/BpfObjectWithStructOpsTestProg.skel.h:222:23:
        error: string literal of length 140144 exceeds maximum length 65536 that C++ compilers
        are required to support [-Werror,-Woverlength-strings]
              return (const void *)"\
                                   ^~
        1 error generated.
      
      Although adding -Wno-overlength-strings could workaround the issue,
      improving llvm BTF generation sounds better esp. for users using vmlinux.h.
      
      Differential Revision: https://reviews.llvm.org/D145816
      
      (cherry picked from commit db3d2ade)
      a824efcd
    • Xi Ruoyao's avatar
      [libunwind][AArch64] Unbreak building with GNU assembler · ab86d147
      Xi Ruoyao authored
      GNU assembler mandates armv8.5-a for memtag instructions. Maybe
      we should remove this restriction in GNU assembler, but let's work
      around it for current GNU Binutils releases.
      
      Differential Revision: https://reviews.llvm.org/D146109
      
      (cherry picked from commit 5d276380)
      ab86d147
    • Nikita Popov's avatar
      [InstCombine] Canonicalize icmp eq pow2 more thoroughly · 526102b3
      Nikita Popov authored
      We currently already canonicalize icmp eq (%x & Pow2), Pow2 to
      icmp ne (%x & Pow2), 0. This patch generalizes the fold based on
      known bits.
      
      In particular, this allows us to handle comparisons against
      !range !{i64 0, i64 2} loads, which addresses an optimization
      regression in Rust caused by 8df376db.
      
      Differential Revision: https://reviews.llvm.org/D146149
      
      (cherry picked from commit 61d2f3a7)
      526102b3
    • Nikita Popov's avatar
      [InstCombine] Add additional test for icmp eq/ne with bool load (NFC) · 7049d589
      Nikita Popov authored
      (cherry picked from commit 9043cb75)
      7049d589
    • Nikita Popov's avatar
      [Pipelines] Restore old DAE position in LTO pipeline · b3ea3484
      Nikita Popov authored
      This is a partial revert of D128830, restoring the previous
      position of DeadArgElim in the fat LTO pipeline. The motivation
      for this is a major code size regression observed in Rust and
      illustrated in the PhaseOrdering test.
      
      This is a conservative fix restoring the previous pipeline order.
      The real problem is that the LTO pipeline is conceptually broken:
      It doesn't have a CGSCC function simplification pipeline. The
      inliner is just being run by itself. This wouldn't be a problem
      if fat LTO used a standard design where ArgPromotion and DAE are
      only run after functions have already been simplified by the
      CGSCC inliner pipeline.
      
      Differential Revision: https://reviews.llvm.org/D146051
      
      (cherry picked from commit fb568344)
      b3ea3484
    • Nikita Popov's avatar
      [PhaseOrdering] Add test for DAE/GlobalDCE interaction (NFC) · 72cb90bd
      Nikita Popov authored
      (cherry picked from commit 8df140c8)
      72cb90bd
  2. Mar 17, 2023
  3. Mar 15, 2023
  4. Mar 11, 2023
  5. Mar 10, 2023
  6. Mar 09, 2023
  7. Mar 08, 2023
  8. Mar 07, 2023
  9. Mar 06, 2023
  10. Mar 04, 2023