1. Feb 02, 2024
    • Fangrui Song's avatar
      [RISCV] Support constraint "s" (#80201) · 10a55cac
      Fangrui Song authored
      GCC has supported a generic constraint "s" for a long time (since at
      least 1992), which references a symbol or label with an optional
      constant offset. "i" is a superset that also supports a constant
      integer.
      
      GCC's RISC-V port also supports a machine-specific constraint "S",
      which cannot be used with a preemptible symbol. (We don't bother to
      check preemptibility.) In PIC code, an external symbol is preemptible by
      default, making "S" less useful if you want to create an artificial
      reference for linker garbage collection, or define sections to hold
      symbol addresses:
      
      ```
      void fun();
      // error: impossible constraint in ‘asm’ for riscv64-linux-gnu-gcc -fpie/-fpic
      void foo() { asm(".reloc ., BFD_RELOC_NONE, %0" :: "S"(fun)); }
      // good even if -fpie/-fpic
      void foo() { asm(".reloc ., BFD_RELOC_NONE, %0" :: "s"(fun)); }
      ```
      
      This patch adds support for "s". Modify https://reviews.llvm.org/D105254
      ("S") to handle multi-depth GEPs (https://reviews.llvm.org/D61560).
      10a55cac
    • Nick Desaulniers's avatar
      6a3fde6d
    • Nikolas Klauser's avatar
      [libc++][NFC] Remove <experimental/__memory> (#80194) · ecb5a1b0
      Nikolas Klauser authored
      The header is unused now, so we can remove it.
      ecb5a1b0
    • Mike Rice's avatar
      [OpenMP] Move unsupported structured bindings diagnostic (#80216) · de1ea787
      Mike Rice authored
      Move the diagnostic so it fires only when doing an OpenMP capture, not
      for non-OpenMP captures. This allows non-OpenMP code to work when using
      OpenMP elsewhere, such as the code reported in
      https://github.com/llvm/llvm-project/issues/66999.
      de1ea787
    • Matin Raayai's avatar
      Fix Passing TargetOptions by Value in TargetMachines for AMDGPU (#79866) · 87e04b47
      Matin Raayai authored
      `TargetOptions` is currently passed by value in AMDGPU targets, which
      makes unnecessary copies. This PR fixes this issue.
      87e04b47
    • lntue's avatar
      94166c6e
    • Yaxun (Sam) Liu's avatar
      [AMDGPU] Mark PC_ADD_REL_OFFSET rematerializable (#79674) · 1f3c3091
      Yaxun (Sam) Liu authored
      Currently machine LICM hoist PC_ADD_REL_OFFSET out of loops, causes
      register pressure when function calls are deep in loops. This is a main
      cause of sgpr spill for programs containing large number of function
      calls in loops.
      
      This patch marks PC_ADD_REL_OFFSET as rematerializable, which eliminates
      sgpr spills due to function calls in loops.
      1f3c3091
    • lntue's avatar
    • jeffreytan81's avatar
      Fix debug info size statistics for split dwarf (#80218) · e0e6236f
      jeffreytan81 authored
      
      
      `statistics dump` command relies on `SymbolFile::GetDebugInfoSize()` to
      get total debug info size.
      The current implementation is missing debug info for split dwarf
      scenarios which requires getting debug info from separate dwo/dwp files.
      This patch fixes this issue for split dwarf by parsing debug info from
      dwp/dwo.
      
      New yaml tests are added.
      
      ---------
      
      Co-authored-by: default avatarjeffreytan81 <jeffreytan@fb.com>
      e0e6236f
    • XDeme's avatar
      [clang-format] Handles Elaborated type specifier for enum in trailing return (#80085) · 7e7f1184
      XDeme authored
      Fixes llvm/llvm-project#80062
      7e7f1184
    • Alexey Bataev's avatar
      7b9bf80a
    • Paschalis Mpeis's avatar
      [NFC] Reorder test lines in arith-fp-frem.ll (#79991) · 46068f5e
      Paschalis Mpeis authored
      Run lines appear in a more natural order:
      - no veclib (neon, sve)
      - neon + veclib
      - sve + veclib
      - sve + tailfold + veclib
      46068f5e
    • lntue's avatar
    • Krystian Stasiowski's avatar
      [Clang][NFC] Remove TemplateArgumentList::OnStack (#79760) · 4739a97f
      Krystian Stasiowski authored
      This patch removes on-stack `TemplateArgumentList`'s. They were primary used
      to pass an `ArrayRef<TemplateArgument>` to
      `Sema::getTemplateInstantiationArgs`, which had a `const
      TemplateArgumentList*` parameter for the innermost template argument
      list. Changing this parameter to an
      `std::optional<ArrayRef<TemplateArgument>>` eliminates the need for
      on-stack `TemplateArgumentList`'s, which in turn eliminates the need for
      `TemplateArgumentList` to store a pointer to its template argument
      storage (which is redundant in almost all cases, as it is an AST
      allocated type).
      4739a97f
    • Kevin Frei's avatar
      Aggregate errors from llvm-dwarfdump --verify (#79648) · bfdd7823
      Kevin Frei authored
      
      
      The amount and format of output from `llvm-dwarfdump --verify` makes it
      quite difficult to know if a change to a tool that produces or modifies
      DWARF is causing new problems, or is fixing existing problems. This diff
      adds a categorized summary of issues found by the DWARF verifier, on by
      default, at the bottom of the error output.
      
      The change includes a new `--error-display` option with 4 settings:
      
      * `--error-display=quiet`: Only display if errors occurred, but no
      details or summary are printed.
      * `--error-display=summary`: Only display the aggregated summary of
      errors with no error detail.
      * `--error-display=details`: Only display the detailed error messages
      with no summary (previous behavior)
      * `--error-display=full`: Display both the detailed error messages and
      the aggregated summary of errors (the default)
      
      I changed a handful of tests that were failing due to new output, adding
      the flag to use the old behavior for all but a couple. For those two I
      added the new aggregated output to the expected output of the test.
      
      The `OutputCategoryAggregator` is a pretty simple little class that
      @clayborg suggested to allow code to only be run to dump detail if it's
      enabled, while still collating counts of the category. Knowing that the
      lambda passed in is only conditionally executed is pretty important
      (handling errors has to be done *outside* the lambda). I'm happy to move
      this somewhere else (and change/improve it) to be more broadly useful if
      folks would like.
      
      ---------
      
      Co-authored-by: default avatarKevin Frei <freik@meta.com>
      bfdd7823
    • jeanPerier's avatar
      [flang] Fix passing NULL to OPTIONAL procedure pointers (#80267) · 09b4649e
      jeanPerier authored
      Procedure pointer lowering used `prepareUserCallActualArgument` because
      it was convenient, but this helper was not meant for POINTERs when
      originally written and it did not handled passing NULL to an OPTIONAL
      procedure pointer correctly.
      
      The resulting argument should be a disassociated pointer, not an absent
      pointer (Fortran 15.5.2.12 point 1.).
      
      Move the logic for procedure pointer argument "cooking" in its own
      helper to avoid triggering the logic that created an absent argument in
      this case.
      09b4649e
    • Emma Pilkington's avatar
      [llvm-objdump][AMDGPU] Pass ELF ABIVersion through disassembler (#78907) · 4eb08109
      Emma Pilkington authored
      Admittedly, its a bit ugly to pass the ABIVersion through onSymbolStart
      but I'm not sure what a better place for it would be.
      4eb08109
    • Amir Ayupov's avatar
    • Anatoly Trosinenko's avatar
      [AArch64] Make +pauth enabled in Armv8.3-a by default (#78027) · a52eea66
      Anatoly Trosinenko authored
      Add AEK_PAUTH to ARMV8_3A in TargetParser and let it propagate to
      ARMV8R, as it aligns with GCC defaults.
      
      After adding AEK_PAUTH, several tests from TargetParserTest.cpp crashed
      when trying to format an error message, thus update a format string in
      AssertSameExtensionFlags to account for bitmask being pre-formatted as
      std::string.
      
      The CHECK-PAUTH* lines in aarch64-target-features.c are updated to
      account for the fact that FEAT_PAUTH support and pac-ret can be enabled
      independently and all four combinations are possible.
      a52eea66
    • Krystian Stasiowski's avatar
      [Clang][Parse] Diagnose member template declarations with multiple declarators (#78243) · c5f46191
      Krystian Stasiowski authored
      According to [temp.pre] p5:
      > In a template-declaration, explicit specialization, or explicit instantiation the init-declarator-list in the declaration shall contain at most one declarator. 
      
      A member-declaration that is a template-declaration or explicit-specialization contains a declaration, even though it declares a member. This means it _will_ contain an init-declarator-list (not a member-declarator-list), so [temp.pre] p5 applies.
      
      This diagnoses declarations such as:
      ```
      struct A
      {
          template<typename T>
          static const int x = 0, f(); // error: a template declaration can only declare a single entity
      
          template<typename T>
          static const int g(), y = 0; // error: a template declaration can only declare a single entity
      };
      ```
      The diagnostic messages are the same as those of the equivalent namespace scope declarations.
      
      Note: since we currently do not diagnose declarations with multiple abbreviated function template declarators at namespace scope e.g., `void f(auto), g(auto);`, so this patch does not add diagnostics for the equivalent member declarations.
      
      This patch also refactors `ParseSingleDeclarationAfterTemplate` (now named `ParseDeclarationAfterTemplate`) to call `ParseDeclGroup` and return the resultant `DeclGroup`.
      c5f46191
    • Ilya Biryukov's avatar
      [Sema] Fix crash in __datasizeof with unknown types (#80300) · 9acd61ec
      Ilya Biryukov authored
      Fixes #80284.
      
      Calling `getASTRecordLayout` on invalid types may crash and results of
      `__datasizeof` on invalid types can be arbitrary, so just use whatever
      `sizeof` returns.
      9acd61ec
    • Simon Pilgrim's avatar
      [X86] X86FixupVectorConstants.cpp - refactor constant search loop to take... · 6ac4fe8d
      Simon Pilgrim authored
      [X86] X86FixupVectorConstants.cpp - refactor constant search loop to take array of sorted candidates
      
      Pulled out of #79815 - refactors the internal FixupConstant logic to just accept an array of vzload/broadcast candidates that are pre-sorted in ascending constant pool size
      6ac4fe8d
  2. Feb 01, 2024