1. Apr 13, 2024
  2. Apr 12, 2024
    • Kunwar Grover's avatar
      [MLIR][Bufferization] Choose default memory space in tensor copy insertion (#88500) · 6f1e23b4
      Kunwar Grover authored
      Tensor copy insertion currently uses memory_space = 0 when creating a
      tensor copy using alloc_tensor. This memory space should instead be the
      default memory space provided in bufferization options.
      6f1e23b4
    • Yingwei Zheng's avatar
      [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (#85863) · e0a62871
      Yingwei Zheng authored
      This patch converts `isKnownNonZero` to use SimplifyQuery. Then we can
      use the context information from `DomCondCache`.
      
      Fixes https://github.com/llvm/llvm-project/issues/85823.
      Alive2: https://alive2.llvm.org/ce/z/QUvHVj
      e0a62871
    • Francis Visoiu Mistrih's avatar
      [RISCV] Remove mayLoad = 1 from store-conditional (#88470) · 72dfee11
      Francis Visoiu Mistrih authored
      lr.[wd]: mayLoad = 1, mayStore = 0
      sc.[wd]: mayLoad = 0, mayStore = 1
      
      all other AMOs: mayLoad = 1, mayStore = 1
      72dfee11
    • Craig Topper's avatar
      [RISCV] Support uimm32 immediates in RISCVInstrInfo::movImm for RV32. (#88464) · 040efafa
      Craig Topper authored
      This allows us to support larger stack offsets for FrameLowering.
      
      Fixes #88365.
      040efafa
    • Nathan Sidwell's avatar
      [BOLT][NFC] Refactor relocation loop (#88424) · 4dd20b07
      Nathan Sidwell authored
      Use the std `if () continue;` idiom before falling into the
      processing.
      4dd20b07
    • Vincent Belliard's avatar
      [lldb] fix dead lock in TypeCategoryMap.cpp (#87540) · 5752e319
      Vincent Belliard authored
      
      
      FormatManager::GetCategoryForLanguage and
      FormatManager::GetCategory(can_create = true) can be called concurrently
      and they both take the TypeCategory::m_map_mutex and the
      FormatManager::m_language_categories_mutex but in reverse order.
      
      On one thread, GetCategoryForLanguage takes m_language_categories_mutex
      and then ends calling TypeCategoryMap::Get which takes m_map_mutex
      
      On another thread GetCategory calls TypeCategoryMap::Add which takes
      m_map_mutex and then calls FormatManager::Changed() which takes
      m_language_categories_mutex
      
      If both threads are running concurrently, we have a dead lock.
      
      The patch releases the m_map_mutex before calling Changed which avoids
      the dead lock.
      
      ---------
      
      Co-authored-by: default avatarVincent Belliard <v-bulle@github.com>
      5752e319
    • Dominik Adamski's avatar
      [Flang][AMDGPU] Add rocm-path flag (#88190) · a27ab3f5
      Dominik Adamski authored
      ROCm installation path is used for finding and automatically linking
      required bitcode libraries for OpenMP AMDGPU offload.
      
      Reported issue: https://github.com/llvm/llvm-project/issues/82553
      a27ab3f5
    • yronglin's avatar
      [Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (#88269) · 986d0dba
      yronglin authored
      This PR fix a AST dump issue since
      https://github.com/llvm/llvm-project/pull/80001
      
      
      
      When Clang dumps `CXXDefaultArgExpr`/`CXXDefaultInitExpr`, there has no
      recursively dump the complete `CXXDefaultArgExpr`/`CXXDefaultInitExpr`.
      
      Since this PR, Clang will recursively dump a
      `CXXDefaultArgExpr`/`CXXDefaultInitExpr` node, even if the node has no
      rewritten init.
      
      *Consider*:
      ```
      struct A {
        int arr[1];
      };
      
      struct B {
        const A &a = A{{0}};
      };
      
      void test() {
        B b{};
      }
      ```
      
      *Before*:
      ```
      `-FunctionDecl <line:9:1, line:11:1> line:9:6 test 'void ()'
        `-CompoundStmt <col:13, line:11:1>
          `-DeclStmt <line:10:3, col:8>
            `-VarDecl <col:3, col:7> col:5 b 'B' listinit
              `-InitListExpr <col:6, col:7> 'B'
                `-CXXDefaultInitExpr <col:7> 'const A' lvalue has rewritten init
                  `-ExprWithCleanups <line:6:16, col:21> 'const A' lvalue
      ```
      
      *After*:
      ```
      `-FunctionDecl 0x15a9455a8 <line:9:1, line:11:1> line:9:6 test 'void ()'
        `-CompoundStmt 0x15a945850 <col:13, line:11:1>
          `-DeclStmt 0x15a945838 <line:10:3, col:8>
            `-VarDecl 0x15a945708 <col:3, col:7> col:5 b 'B' listinit
              `-InitListExpr 0x15a9457b0 <col:6, col:7> 'B'
                `-CXXDefaultInitExpr 0x15a9457f8 <col:7> 'const A' lvalue has rewritten init
                  `-ExprWithCleanups 0x15a945568 <line:6:16, col:21> 'const A' lvalue
                    `-MaterializeTemporaryExpr 0x15a945500 <col:16, col:21> 'const A' lvalue extended by Field 0x15a945160 'a' 'const A &'
                      `-ImplicitCastExpr 0x15a9454e8 <col:16, col:21> 'const A' <NoOp>
                        `-CXXFunctionalCastExpr 0x15a9454c0 <col:16, col:21> 'A' functional cast to A <NoOp>
                          `-InitListExpr 0x15a9452c0 <col:17, col:21> 'A'
                            `-InitListExpr 0x15a945308 <col:18, col:20> 'int[1]'
                              `-IntegerLiteral 0x15a945210 <col:19> 'int' 0
      ```
      
      ---------
      
      Signed-off-by: default avataryronglin <yronglin777@gmail.com>
      986d0dba
    • Adam Fowler's avatar
      Add lldb-dap to Swift distributions (#88482) · 2c2377d3
      Adam Fowler authored
      This includes the lldb-dap executable in the MacOS and Linux
      distributions of Swift. Currently there is a commit in the Apple repo to
      do this for just MacOS https://github.com/apple/llvm-project/pull/8176.
      This PR extends this to both Linux and MacOS and brings the change
      upstream.
      
      @JDevlieghere @adrian-prantl
      2c2377d3
    • Björn Pettersson's avatar
      [SelectionDAG] Fix and improve TargetLowering::SimplifySetCC (#87646) · 33e6b488
      Björn Pettersson authored
      The load narrowing part of TargetLowering::SimplifySetCC is updated
      according to this:
      
      1) The offset calculation (for big endian) did not work properly for
         non byte-sized types. This is basically solved by an early exit
         if the memory type isn't byte-sized. But the code is also corrected
         to use the store size when calculating the offset.
      2) To still allow some optimizations for non-byte-sized types the
         TargetLowering::isPaddedAtMostSignificantBitsWhenStored hook is
         added. By default it assumes that scalar integer types are padded
         starting at the most significant bits, if the type needs padding
         when being stored to memory.
      3) Allow optimizing when isPaddedAtMostSignificantBitsWhenStored is
         true, as that hook makes it possible for TargetLowering to know
         how the non byte-sized value is aligned in memory.
      4) Update the algorithm to always search for a narrowed load with
         a power-of-2 byte-sized type. In the past the algorithm started
         with the the width of the original load, and then divided it by
         two for each iteration. But for a type such as i48 that would
         just end up trying to narrow the load into a i24 or i12 load,
         and then we would fail sooner or later due to not finding a
         newVT that fulfilled newVT.isRound().
         With this new approach we can narrow the i48 load into either
         an i8, i16 or i32 load. By checking if such a load is allowed
      (e.g. alignment wise) for any "multiple of 8 offset", then we can find
         more opportunities for the optimization to trigger. So even for a
         byte-sized type such as i32 we may now end up narrowing the load
         into loading the 16 bits starting at offset 8 (if that is allowed
         by the target). The old algorithm did not even consider that case.
      5) Also start using getObjectPtrOffset instead of getMemBasePlusOffset
         when creating the new ptr. This way we get "nsw" on the add.
      33e6b488
    • Bjorn Pettersson's avatar
      [ARM][PowerPC] Add regression tests for narrowing load in TargetLowering::SimplifySetCC · bcf047a4
      Bjorn Pettersson authored
      These test cases show some miscomplies for big-endian when dealing
      with non byte-sized loads. One part of the problem is that LLVM IR
      isn't really telling where the padding goes for non byte-sized
      loads/stores. So currently TargetLowering::SimplifySetCC can't assume
      anything about it. But the implementation also do not consider that
      the TypeStoreSize could be larger than the TypeSize, resulting in
      the offset calculation being wrong for big-endian.
      
      Pre-commit for https://github.com/llvm/llvm-project/pull/87646
      bcf047a4
    • Michael Buch's avatar
      [lldb][test] Add tests for evaluating local variables whose name clashes with... · 9d8ccbc1
      Michael Buch authored
      [lldb][test] Add tests for evaluating local variables whose name clashes with Objective-C types (#87807)
      
      Depends on https://github.com/llvm/llvm-project/pull/87767
      9d8ccbc1