1. Oct 25, 2023
    • Min-Yih Hsu's avatar
      [RISCV][GISel] Add ISel support for SHXADD_UW and SLLI.UW (#69972) · cdcaef87
      Min-Yih Hsu authored
      This patch also includes:
        - Remove legacy non_imm12 PatLeaf from RISCVInstrInfoZb.td
      - Implement a custom GlobalISel operand renderer for TrailingZeros
      SDNodeXForm
      cdcaef87
    • Craig Topper's avatar
      [GISel] Make assignValueToReg take CCValAssign by const reference. (#70086) · 2f4328e6
      Craig Topper authored
      This was previously passed by value. It used to be passed by non-const
      reference, but it was changed to value in D110610. I'm not sure why.
      2f4328e6
    • michaelrj-google's avatar
      [libc] Fix printf long double inf, bitcast in msan (#70067) · b4e55299
      michaelrj-google authored
      These bugs were found with the new printf long double fuzzing. The long
      double inf vs nan bug was introduced when we changed to
      get_explicit_exponent. The bitcast msan issue hadn't come up previously,
      but isn't a real bug, just a poisoning confusion.
      b4e55299
    • Fazlay Rabbi's avatar
      [OpenMP 5.2] Initial parsing and semantic analysis suppport for 'step' modifier on 'linear' clause · 567a660a
      Fazlay Rabbi authored
      Reference:
      (1) OpenMP 5.2 Specification - Seciton 5.4.6
      
      Differential revision: https://reviews.llvm.org/D159546
      567a660a
    • Alexey Bataev's avatar
      [SLP][NFC]Remove unused variables, NFC. · a3c68754
      Alexey Bataev authored
      a3c68754
    • Chris Carlon's avatar
      [clangd] Support `-stdlib` flags in SystemIncludeExtractor. (#69283) · 3935a29a
      Chris Carlon authored
      
      
      The `--stdlib` flag can affect the system headers used by `clang` during
      compilation. By default, `clang` will use the platform-installed C++
      standard headers, but with `--stdlib=libc++`, `clang` can use headers
      included in the distribution for its `libc++` implementation.
      
      Prior to this patch, if `compile_commands.json` specified
      `-stdlib=libc++` or an equivalent form and `--query-driver` took effect,
      `clangd` would ignore `stdlib` and index based on the platform's
      headers. When these mismatch, e.g. due to version differences,
      `clangd`'s completions and the actual compilation can differ.
      
      fixes clangd/clangd#1784
      
      ---------
      
      Co-authored-by: default avatarChris Carlon <cjc25@cjc25.com>
      3935a29a
    • robozati's avatar
      [clangd] Do not offer RawStringLiteral code action in C and C++98 (#69775) · 2f3d4f6c
      robozati authored
      Raw string literals are a C++ feature first added in C++11.
      
      Fixes https://github.com/clangd/clangd/issues/1795.
      2f3d4f6c
    • Luke Lau's avatar
    • Kiran Chandramohan's avatar
      [OpenMP][MLIR] Use opaque pointers in OpenMP translation tests 1/2 (#70057) · 14520fa3
      Kiran Chandramohan authored
      First half of the tests switching to opaque pointers. Rest of the tests
      are omptarget-*.mlir and a specific test for typed pointers.
      Patch created as requested in
      https://github.com/llvm/llvm-project/pull/69772
      14520fa3
    • Amara Emerson's avatar
      [AArch64][GlobalISel] Add support for post-indexed loads/stores. (#69532) · 1b11729d
      Amara Emerson authored
      Gives small code size improvements across the board at -Os CTMark.
      
      Much of the work is porting the existing heuristics in the DAGCombiner.
      1b11729d
    • Leonard Chan's avatar
      Reapply "[compiler-rt] Allow Fuchsia to use 64-bit allocator for RISCV (#68343)" · bac3808a
      Leonard Chan authored
      This reverts commit 37432c15.
      
      The tunings for the lsan allocator for Fuchsia on RISCV should be
      adjusted.
      bac3808a
    • Guray Ozen's avatar
      [mlir] Fix nvvm integration tests build error (#70113) · f8058a37
      Guray Ozen authored
      #69934 broke integration tests that rely on the
      kernel-bare-ptr-calling-convention and host-bare-ptr-calling-convention
      flags. This PR brings these flags.
      
      Also the kernel-index-bitwidth flag is removed, as kernel pointer size
      depends on the host. Separating host (64-bit) and kernel (32-bit) is not
      viable.
      f8058a37
    • Peiming Liu's avatar
    • Aart Bik's avatar
      [mlir][sparse] add COO to python tests (#70090) · 260dbb45
      Aart Bik authored
      also typo fix
      260dbb45
    • Valery Dmitriev's avatar
      [NFC][SLP] Add test case for issue #69670. (#70088) · 117041da
      Valery Dmitriev authored
      Test exposes issue with delayed gather emission, which may lead to
      generating an instruction which does not dominate all users.
      117041da
    • Craig Topper's avatar
      [DAGCombiner] Fix misuse of getZeroExtendInReg in SimplifySelectCC. (#70066) · 20020c1b
      Craig Topper authored
      If VT has less bits than SCC, using a ZeroExtendInReg isn't going to fix
      it. That's an AND instruction. We need to truncate the value instead.
      
      This should be ok because we already checked that the boolean contents
      is ZeroOrOne so the setcc can only produce 0 or 1.
      
      No test because I found this while trying to make i32 legal for RISC-V
      64 which I'm not ready to upload yet. You can see in the coverage report
      that this line isn't tested today.
      
      
      https://lab.llvm.org/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp.html#L27270
      20020c1b
    • maksfb's avatar
      [BOLT] Fix incorrect basic block output addresses (#70000) · 8244ff67
      maksfb authored
      Some optimization passes may duplicate basic blocks and assign the same
      input offset to a number of different blocks in a function. This is done
      e.g. to correctly map debugging ranges for duplicated code.
      
      However, duplicate input offsets present a problem when we use
      AddressMap to generate new addresses for basic blocks. The output
      address is calculated based on the input offset and will be the same for
      blocks with identical offsets. The result is potentially incorrect debug
      info and BAT records.
      
      To address the issue, we have to eliminate the dependency on input
      offsets while generating output addresses for a basic block. Each block
      has a unique label, hence we extend AddressMap to include address lookup
      based on MCSymbol and use the new functionality to update block
      addresses.
      8244ff67
    • Aiden Grossman's avatar
      [Github] Add support for building libc docs in Github actions (#69824) · 888f0703
      Aiden Grossman authored
      This patch adds support for building the libc docs in Github actions.
      This eanbles easily diagnosing doc build failures/warnings in PRs and at
      the tip of tree.
      888f0703
    • Jakub Mazurkiewicz's avatar
      [libc++] Update status of P2770R0, P2441R2 and P2711R1 (#70045) · e1e0598e
      Jakub Mazurkiewicz authored
      This patch adds a mention that the following papers are in progress:
      
      * P2770R0: #66033
      * P2441R2 and P2711R1: #65536
      e1e0598e
    • Philip Reames's avatar
      [RISCV][InsertVSETVLI] Add Subtarget variable to class [nfc] · 2732860d
      Philip Reames authored
      A bit debateable since we could extract it from the MachineFunction (and
      thus the MachineInstr), but we have the same pattern for MachineFunction
      associated structure already for TII and MRI.
      2732860d
    • Philip Reames's avatar
      Revert "[dsymutil] Add support for mergeable libraries" · 717946f9
      Philip Reames authored
      This reverts commit 122c89b2. Change does not build, with errors such as:
      
      In file included from ../llvm-project/llvm/tools/dsymutil/DebugMap.h:24,
                       from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13,
                       from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9:
      ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:60:17: error: declaration of ‘llvm::dsymutil::SymbolMapping llvm::dsymutil::ValidReloc::SymbolMapping’ changes meaning of ‘SymbolMapping’ [-fpermissive]
         60 |   SymbolMapping SymbolMapping;
            |                 ^~~~~~~~~~~~~
      ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:36:8: note: ‘SymbolMapping’ declared here as ‘struct llvm::dsymutil::SymbolMapping’
         36 | struct SymbolMapping {
            |        ^~~~~~~~~~~~~
      In file included from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13,
                       from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9:
      ../llvm-project/llvm/tools/dsymutil/DebugMap.h:198:32: error: declaration of ‘std::optional<llvm::dsymutil::RelocationMap> llvm::dsymutil::DebugMapObject::RelocationMap’ changes meaning of ‘RelocationMap’ [-fpermissive]
        198 |   std::optional<RelocationMap> RelocationMap;
            |                                ^~~~~~~~~~~~~
      In file included from ../llvm-project/llvm/tools/dsymutil/DebugMap.h:24,
                       from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.h:13,
                       from ../llvm-project/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp:9:
      ../llvm-project/llvm/tools/dsymutil/RelocationMap.h:76:7: note: ‘RelocationMap’ declared here as ‘class llvm::dsymutil::RelocationMap’
         76 | class RelocationMap {
            |       ^~~~~~~~~~~~~
      717946f9
    • Amir Ayupov's avatar
      [BOLT] Fix build issues after #69836 (#70087) · 3a72bcbf
      Amir Ayupov authored
      Fix clang build (`return Error => return std::move(Error)`)
      3a72bcbf
    • cor3ntin's avatar
      [Clang] Mark declarators invalid in the presence of ill-formed explicit parameters. (#70018) · 20d97adf
      cor3ntin authored
      To avoid crashes later in sema.
      
      Fixes #69962
      Fixes #69838
      20d97adf
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang][openacc] Support single array element in data clause (#70065) · 570c168e
      `gatherDataOperandAddrAndBounds` was crashing when a single array
      element was passed in a data clause. This patch fixes the issue.
      570c168e
    • Philip Reames's avatar
      fa7c50d0
    • Peiming Liu's avatar
    • antangelo's avatar
      Reland "[clang][Sema] Use original template pattern when declaring implicit... · f4183197
      antangelo authored
      Reland "[clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes" (#69676)
      
      Reland of dd0fba11
      
      When a nested template is instantiated, the template pattern of the
      inner class is not copied into the outer class
      ClassTemplateSpecializationDecl. The specialization contains a
      ClassTemplateDecl with an empty record that points to the original
      template pattern instead.
      
      As a result, when looking up the constructors of the inner class, no
      results are returned. This patch finds the original template pattern and
      uses that for the lookup instead.
      
      Based on CWG2471 we must also substitute the known outer template
      arguments when creating deduction guides for the inner class.
      
      Changes from the last iteration:
      1. The outer retained levels from the outer template are always added to
      the `MultiLevelTemplateArgumentList` for rewriting
      `FunctionTemplateDecl` arguments, even if there is no FTD and the
      arguments are empty.
      2. When building implicit deduction guides, the template pattern
      underlying decl is pushed as the current context. This resolves the
      issue where `FindInstantiatedDecl` is unable to find the inner template
      class.
      3. Tests are updated to cover the failing case, and to assert that the
      type is correct after argument deduction in the implicit case.
      f4183197
    • Adrian Prantl's avatar
      Expose DWARFDIE::GetDeclContext() in lldb_private::Function. (#69981) · 49504674
      Adrian Prantl authored
      I need this API in the Swift plugin, but it seems generally useful
      enough to expose it in the main branch.
      49504674
    • Felix Schneider's avatar
      [mlir][tosa] Add verifiers to ReduceOps, fix shape inference crash (#69843) · 8a57bc09
      Felix Schneider authored
      This patch adds verifiers to `tosa.reduce_*` ops that check, among other things,
      that the supplied `axis` argument is compatible with the input/output tensors'
      shapes. We allow for a special case of `axis == 0 && rank == 0` to be valid.
      This patch also adds a check to `ReduceInferReturnTypes()` to ensure that the
      shape inference pass doesn't crash on an invalid `axis` argument anymore.
      
      Fix https://github.com/llvm/llvm-project/issues/68187
      8a57bc09
    • Zahira Ammarguellat's avatar
      Revert "[clang] Support fixed point types in C++ (#67750)" (#69963) · d593f6cb
      Zahira Ammarguellat authored
      This reverts commit a3a7d631.
      
      When compiling with MSVC2022 in  C++32 mode this is giving an error.
      Compiling this simple test case:
      t1.cpp:
      with -std=c++23 will give the following error:
      
      In file included from C:\Users\zahiraam\t1.cpp:1:
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3329:16:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3329 |         _Vbase _Accum = 0;
            |                ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3329:23:
      error:
            expected unqualified-id
       3329 |         _Vbase _Accum = 0;
            |                       ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3334:13:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3334 |             _Accum |= _Tmp ? _Mask : _Vbase{0};
            |             ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3334:20:
      error:
            expected unqualified-id
       3334 |             _Accum |= _Tmp ? _Mask : _Vbase{0};
            |                    ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3336:53:
      error:
            expected '(' for function-style cast or type construction
       3336 |                 this->_Emplace_back_unchecked(_Accum);
            |                                               ~~~~~~^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3337:17:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3337 |                 _Accum = 0;
            |                 ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3337:24:
      error:
            expected unqualified-id
       3337 |                 _Accum = 0;
            |                        ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3343:49:
      error:
            expected '(' for function-style cast or type construction
       3343 |             this->_Emplace_back_unchecked(_Accum);
            |                                           ~~~~~~^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3352:16:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3352 |         _Vbase _Accum    = 0;
            |                ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3352:26:
      error:
            expected unqualified-id
       3352 |         _Vbase _Accum    = 0;
            |                          ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3357:13:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3357 |             _Accum |= _Tmp ? _Mask : _Vbase{0};
            |             ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3357:20:
      error:
            expected unqualified-id
       3357 |             _Accum |= _Tmp ? _Mask : _Vbase{0};
            |                    ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3359:46:
      error:
            expected '(' for function-style cast or type construction
       3359 |                 this->_Myvec.push_back(_Accum);
            |                                        ~~~~~~^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3360:17:
      error:
            compile with '-ffixed-point' to enable fixed point types
       3360 |                 _Accum = 0;
            |                 ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3360:24:
      error:
            expected unqualified-id
       3360 |                 _Accum = 0;
            |                        ^
      c:\Program files\Microsoft Visual
      Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\vector:3366:42:
      error:
            expected '(' for function-style cast or type construction
       3366 |             this->_Myvec.push_back(_Accum);
            |                                    ~~~~~~^
      16 errors generated.
      
      See also comment here:
      https://github.com/llvm/llvm-project/pull/67750#issuecomment-1775264907
      d593f6cb
    • Ilya Leoshkevich's avatar
      [OpenMP][Tests] Sync struct DEP with the runtime (#69982) · 77c2b623
      Ilya Leoshkevich authored
      struct DEP defined in multiple testcases must correspond to runtime's
      struct kmp_depend_info. The former defines flags as int, and the latter
      as kmp_uint8_t. This discrepancy goes unnoticed on little-endian
      systems, but breaks big-endian ones.
      
      Make flags in struct DEP unsigned char.
      77c2b623
    • Ilya Leoshkevich's avatar
      [OpenMP] Provide big-endian bitfield definitions (#69995) · 34459b72
      Ilya Leoshkevich authored
      structs kmp_depend_info.flags and kmp_tasking_flags contain bitfields,
      which overlay integer flag values. The current bitfield definitions
      target little-endian machines. On big-endian machines bitfields are laid
      out in the opposite order, so the current definitions do not work there.
      
      There are two ways to fix this: either provide big-endian bitfield
      definitions, or bit-swap integer flag values. Go with the former, since
      it's localized to one place and therefore is more maintainable.
      34459b72
    • Alpha Abdoulaye's avatar
      [dsymutil] Add support for mergeable libraries · 122c89b2
      Alpha Abdoulaye authored
      This adds support in dsymutil for mergeable libraries [1].
      
      dsymutil reads a new stab emitted by ld, allowing it to operate on
      dynamic libraries instead of object files. It also now loads the DWARF
      files associated to the libraries, and build the debug map for each
      binary from the list of symbols exported by the library. For each Debug
      Map Object, there is a new associated Relocation Map which is serialized
      from the information retrieved in the original debug_info (or
      debug_addr) section of the .o file.
      
      The final DWARF file has multiple compile units, so the offsets
      information of the relocations are adjusted relatively to the compile
      unit they will end up belonging to, inside the final linked DWARF file.
      
      [1] https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries
      
      Differential revision: https://reviews.llvm.org/D158124
      122c89b2
    • Jakub Kuderski's avatar
      [ADT] Support appending multiple values (#69891) · 4c28e666
      Jakub Kuderski authored
      This is so that we can append multiple values at once without having to
      create a temporary array or repeatedly call `push_back`.
      
      Use the new function `append_values` to clean up the SPIR-V serializer
      code. (NFC)
      4c28e666
    • Harvin Iriawan's avatar
      [Analysis] Add Scalable field in MemoryLocation.h (#69716) · 211dc4ad
      Harvin Iriawan authored
      This is the first of a series of patch to improve Alias Analysis on
        Scalable quantities.
        Keep Scalable information from TypeSize which
        will be used in Alias Analysis.
      211dc4ad
    • Fazlay Rabbi's avatar
      [OpenMP 5.2] Deprecate syntax of map modifiers without comma separators (#69534) · 86b4388c
      Fazlay Rabbi authored
      The syntax of modifiers without comma separators in the map clause was
      deprecated in OpenMP 5.2.
      
      Reference: OpenMP 5.2 Spec, page 627, line 19
      86b4388c
    • Rainer Orth's avatar
      [builtins] Fix floattitf.c etc. compilation on Solaris/SPARC (#70058) · ad7611da
      Rainer Orth authored
      69660ccf broke the [Solaris/sparcv9
      buildbot](https://lab.llvm.org/staging/#/builders/12/builds/264):
      `compiler-rt/lib/builtins/int_to_fp.h` unconditionally uses `*int128_t`
      which don't exist on 32-bit SPARC.
      
      As suggested in https://github.com/llvm/llvm-project/pull/67540, this
      patch fixes this by moving the `CRT_HAS_TF_MODE` guard up which does the
      necessary checks.
      
      Tested on `sparcv9-sun-solaris2.11`.
      ad7611da
    • Craig Topper's avatar
      [GISel] Pass MPO and VA to assignValueToAddress by const reference. NFC (#69810) · 9f592cbc
      Craig Topper authored
      Previously they were passed by non-const reference. No in tree target
      modifies the values.
      
      This makes it possible to call assignValueToAddress from
      assignCustomValue without a const_cast. For example in this patch
      https://github.com/llvm/llvm-project/pull/69138.
      9f592cbc
    • Augusto Noronha's avatar
      [lldb][gardening] Remove full name of "DWARFDIE" type in GetTypeForDIE (#70062) · e3476f68
      Augusto Noronha authored
      When moving the GetTypeForDIE function from DWARFASTParserClang to
      DWARFASTParser, I kept the signature as-is. To match the rest of the
      function signatures in DWARFASTParser, remove the full name
      (lldb_private::plugin::dwarf::DWARFDIE -> DWARFDIE) in the signature of
      DWARFASTParser::GetTypeForDIE.
      e3476f68
    • Alexander Richardson's avatar
      [builtins] Support building the 128-bit float functions on ld80 platforms (#68132) · d2ce3e96
      Alexander Richardson authored
      GCC provides these functions (e.g. __addtf3, etc.) in libgcc on x86_64.
      Since Clang supports float128, we can also enable the existing code by
      using float128 for fp_t if either __FLOAT128__ or __SIZEOF_FLOAT128__ is
      defined instead of only supporting these builtins for platforms with
      128-bit IEEE long doubles.
      This commit defines a new tf_float typedef that matches a float with
      attribute((mode(TF)) on each given architecture.
      
      There are more tests that could be enabled for x86, but to keep the diff
      smaller, I restricted test changes to ones that started failing as part
      of this refactoring.
      
      This change has been tested on x86 (natively) and
      aarch64,powerpc64,riscv64 and sparc64 via qemu-user.
      
      This supersedes https://reviews.llvm.org/D98261 and should also cover
      the changes from https://github.com/llvm/llvm-project/pull/68041.
      d2ce3e96