1. Oct 17, 2023
  2. Oct 16, 2023
    • Owen Pan's avatar
      [clang-format] Fix a bug in RemoveParentheses: ReturnStatement (#67911) · 7a23a5d4
      Owen Pan authored
      Don't remove the outermost parentheses surrounding a return statement
      expression when inside a function/lambda that has the decltype(auto)
      return type.
      
      Fixed #67892.
      
      (cherry picked from commit 75441a68)
      7a23a5d4
    • Noah Goldstein's avatar
      [X86] Fix logic for optimizing movmsk(bitcast(shuffle(x))); PR67287 · be4016e5
      Noah Goldstein authored
      Prior logic would remove the shuffle iff all of the elements in `x`
      where used. This is incorrect.
      
      The issue is `movmsk` only cares about the highbits, so if the width
      of the elements in `x` is smaller than the width of the elements
      for the `movmsk`, then the shuffle, even if it preserves all the elements,
      may change which ones are used by the highbits.
      
      For example:
      `movmsk64(bitcast(shuffle32(x, (1,0,3,2))))`
      
      Even though the shuffle mask `(1,0,3,2)` preserves all the elements, it
      flips which will be relevant to the `movmsk64` (x[1] and x[3]
      before and x[0] and x[2] after).
      
      The fix here, is to ensure that the shuffle mask can be scaled to the
      element width of the `movmsk` instruction. This ensure that the
      "high" elements stay "high". This is overly conservative as it
      misses cases like `(1,1,3,3)` where the "high" elements stay
      intact despite not be scalable, but for an relatively edge-case
      optimization that should generally be handled during
      simplifyDemandedBits, it seems okay.
      
      (cherry picked from commit 1684c65b)
      be4016e5
    • Noah Goldstein's avatar
      496b1740
    • Martin Storsjö's avatar
      [clang] [MinGW] Explicitly always pass the -fno-use-init-array (#68571) · f50c6382
      Martin Storsjö authored
      On MinGW targets, the .ctors section is always used for constructors.
      
      When using the .ctors section, the constructors need to be emitted in
      reverse order to get them execute in the right order. (Constructors with
      a specific priority are sorted separately by the linker later.) In LLVM,
      in CodeGen/AsmPrinter/AsmPrinter.cpp, there's code that reverses them
      before writing them out, executed when using the .ctors section. This
      logic is done whenever TM.Options.UseInitArray is set to false. Thus,
      make sure to set UseInitArray to false for this target.
      
      This fixes https://github.com/llvm/llvm-project/issues/55938.
      
      (cherry picked from commit a2b8c49c)
      f50c6382
    • DianQK's avatar
      [LVI][CVP] Treat undef like a full range (#68190) · d10b731a
      DianQK authored
      When converting to ConstantRange, we should treat undef like a full range.
      Fixes #68381.
      
      (cherry picked from commit 81857940)
      d10b731a
  3. Oct 10, 2023
    • Simon Pilgrim's avatar
      [X86] combineConcatVectorOps - only concatenate single-use subops · 37b79e77
      Simon Pilgrim authored
      We could maybe extend this by allowing the lowest subop to have multiple uses and extract the lowest subvector result of the concatenated op, but let's just get the fix in first.
      
      Fixes #67333
      37b79e77
    • Tobias Hieta's avatar
      Bump version to 17.0.3 · 5a13ce2d
      Tobias Hieta authored
      5a13ce2d
    • Arvind Mukund's avatar
      [clang] Correct behavior of `LLVM_UNREACHABLE_OPTIMIZE=OFF` for `Release` builds (#68284) · e7b3b94c
      Arvind Mukund authored
      ```c++
      AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) {
        AttributeCommonInfo I(Range, NoSemaHandlerAttribute, (
          S == GNU_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
          S == CXX11_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
          S == C23_clang_aarch64_sve_pcs ? AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/} :
          (llvm_unreachable("Unknown attribute spelling!"),  AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/})));
        return CreateImplicit(Ctx, I);
      }
      ```
      
      ```c++
      AArch64SVEPcsAttr *AArch64SVEPcsAttr::CreateImplicit(ASTContext &Ctx, SourceRange Range, Spelling S) {
        AttributeCommonInfo I(Range, NoSemaHandlerAttribute, [&]() {
          switch (S) {
          case GNU_aarch64_sve_pcs:
            return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, GNU_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
          case CXX11_clang_aarch64_sve_pcs:
            return AttributeCommonInfo::Form{AttributeCommonInfo::AS_CXX11, CXX11_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
          case C23_clang_aarch64_sve_pcs:
            return AttributeCommonInfo::Form{AttributeCommonInfo::AS_C23, C23_clang_aarch64_sve_pcs, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
          default:
            llvm_unreachable("Unknown attribute spelling!");
            return AttributeCommonInfo::Form{AttributeCommonInfo::AS_GNU, 0, false /*IsAlignas*/, false /*IsRegularKeywordAttribute*/};
          }
        }());
        return CreateImplicit(Ctx, I);
      }
      ```
      
      Fixes https://github.com/llvm/llvm-project/issues/68237
      Conflicts:
      	clang/docs/ReleaseNotes.rst
      e7b3b94c
    • Martin Storsjö's avatar
      [LLD] [COFF] Fix handling of comdat .drectve sections (#68116) · f0a687d8
      Martin Storsjö authored
      This can happen when manually emitting strings into .drectve sections
      with `__attribute__((section(".drectve")))`, which is a way to emulate
      `#pragma comment(linker, "...")` for mingw compilers, without requiring
      building with -fms-extensions.
      
      Normally, this doesn't generate any comdat, but if compiled with
      -fsanitize=address, this section does get turned into a comdat section.
      
      This fixes #67261. This issue can be seen as a regression; a change in
      the "lli" tool in 17.x triggers this case, if compiled with ASAN
      enabled, triggering this unsupported corner case in LLD. With this
      change, LLD can handle it.
      
      (cherry picked from commit 503bc5f6)
      f0a687d8
    • Tom Stellard's avatar
      workflows/release-binaries: Use more cores to avoid the 6 hour timeout (#67874) · 8a8ade49
      Tom Stellard authored
      (cherry picked from commit 95b2c6b3)
      8a8ade49
    • Martin Storsjö's avatar
      [AArch64] Disable loop alignment for Windows targets (#67894) · 1090b91a
      Martin Storsjö authored
      This should fix #66912. When emitting SEH unwind info, we need to be
      able to calculate the exact length of functions before alignments are
      fixed. Until that limitation is overcome, just disable all loop
      alignment on Windows targets.
      
      (cherry picked from commit 6ae36c01)
      1090b91a
    • Shoaib Meenai's avatar
      [Sema] Use underlying type of scoped enum for -Wformat diagnostics (#67378) · 69c8c966
      Shoaib Meenai authored
      Right now, `-Wformat` for a scoped enum will suggest a cast based on the
      format specifier being used. This can lead to incorrect results, e.g.
      attempting to format a scoped enum with `%s` would suggest casting to
      `char *` instead of fixing the specifier. Change the logic to treat the
      scoped enum's underlying type as the intended type to be printed, and
      suggest format specifier changes and casts based on that.
      
      (cherry picked from commit 0b07b06e)
      69c8c966
  4. Oct 03, 2023
  5. Sep 29, 2023
  6. Sep 28, 2023
  7. Sep 27, 2023