1. Mar 23, 2023
    • Jay Foad's avatar
      [flang] Fix dereference of std::optional with no value · 2ecbe73c
      Jay Foad authored
      Differential Revision: https://reviews.llvm.org/D142648
      
      (cherry picked from commit 6772966d)
      2ecbe73c
    • Weining Lu's avatar
      [LLDB][ObjectFileELF] Correct the return type of Reloc{Offset,Addend}32 · 0e227de0
      Weining Lu authored
      This is a follow up of D145550.
      
      I think Reloc{Type,Symbol}{32,64} can keep unchanged as they are not
      directly returning a field of the ELFRel[a] struct.
      
      Reviewed By: DavidSpickett
      
      Differential Revision: https://reviews.llvm.org/D145571
      
      (cherry picked from commit 27705f45)
      0e227de0
    • Weining Lu's avatar
      [LLDB][ObjectFileELF] Correct the return type of RelocOffset64 and RelocAddend64 · 7d28293f
      Weining Lu authored
      According to `/usr/include/elf.h` and `lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h`.
      For ELF64 relocation, types of `offset` and `addend` should be `elf_addr` and `elf_sxword`.
      
      Reviewed By: DavidSpickett
      
      Differential Revision: https://reviews.llvm.org/D145550
      
      (cherry picked from commit 174a38f9)
      7d28293f
    • Weining Lu's avatar
      [LLDB][ObjectFileELF] Support LoongArch64 in ApplyReloctions · 6d3b7679
      Weining Lu authored
      Currently ApplyReloctions() deals with different archs' relocation types
      together (in a single `switch() {..}`). I think it is incorrect because
      different relocation types of different archs may have same enum values.
      
      For example:
      `R_LARCH_32` and `R_X86_64_64` are both `1`;
      `R_LARCH_64` and `R_X86_64_PC32` are both `2`.
      
      This patch handles each arch in seperate `switch()` to solve the enum
      values conflict issue.
      
      And a new test is added for LoongArch64.
      
      Reviewed By: DavidSpickett
      
      Differential Revision: https://reviews.llvm.org/D145462
      
      (cherry picked from commit c2c93873)
      6d3b7679
    • 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
    • Daniel Thornburgh's avatar
      [llvm-cov] Create syntax to pass source w/o binary. · 60bba0f5
      Daniel Thornburgh authored
      Since binary ID lookup makes CLI object arguments optional, it should be
      possible to pass a list of source files without a binary. Unfortunately,
      the current syntax will always interpret the first source file as a
      binary. This change adds a `-sources` option to cause all later
      positional arguments to be considered sources.
      
      Reviewed By: gulfem
      
      Differential Revision: https://reviews.llvm.org/D144207
      
      (cherry picked from commit 8007bcc1)
      60bba0f5
    • Arseniy Zaostrovnykh's avatar
      Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location."... · f8514f04
      Arseniy Zaostrovnykh authored
      Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions
      
      Builtin functions (such as `std::move`, `std::forward`, `std::as_const`)
      have a body generated during the analysis not related to any source file
      so their statements have no valid source locations.
      `ReturnPtrRange` checker should not report issues for these builtin
      functions because they only forward its parameter and do not create any
      new pointers.
      
      Fixes #55347
      
      Patch by Arseniy Zaostrovnykh.
      
      Reviewed By: NoQ
      
      Differential Revision: https://reviews.llvm.org/D138713
      
      (cherry picked from commit 98d55095)
      f8514f04