1. Nov 11, 2023
    • Fangrui Song's avatar
      Revert "[Support]Look up in top-level subcommand as a fallback when looking... · 2ff090e5
      Fangrui Song authored
      Revert "[Support]Look up in top-level subcommand as a fallback when looking options for a custom subcommand. (#71776)"
      
      This reverts commit b88308b1.
      2ff090e5
    • Quinn Dawkins's avatar
      [mlir][vector] Notify the rewriter when sinking out of warp ops (#71964) · aa2376a0
      Quinn Dawkins authored
      A number of the warp distribution patterns work by rewriting a warp op
      in place by moving a contained op outside. This notifies the rewriter
      that the warp op is changing in this case.
      aa2376a0
    • Mingming Liu's avatar
      Revert "[Support]Look up in top-level subcommand as a fallback when looking... · 2e912a2b
      Mingming Liu authored
      Revert "[Support]Look up in top-level subcommand as a fallback when looking options for a custom subcommand (#71975)
      
      …ooking options for a custom subcommand. (#71776)"
      
      This reverts commit b88308b1.
      
      The build-bot is unhappy
      (https://lab.llvm.org/buildbot/#/builders/186/builds/13096),
      `GroupingAndPrefix` fails after `TopLevelOptInSubcommand` (the newly
      added test).
      
      Revert while I look into this (might be related with test sharding but
      not sure)
      
      ```
      
      [----------] 3 tests from CommandLineTest
      [ RUN      ] CommandLineTest.TokenizeWindowsCommandLine2
      [       OK ] CommandLineTest.TokenizeWindowsCommandLine2 (0 ms)
      [ RUN      ] CommandLineTest.TopLevelOptInSubcommand
      [       OK ] CommandLineTest.TopLevelOptInSubcommand (0 ms)
      [ RUN      ] CommandLineTest.GroupingAndPrefix
       #0 0x00ba8118 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x594118)
       #1 0x00ba5914 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x591914)
       #2 0x00ba89c4 SignalHandler(int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5949c4)
       #3 0xf7828530 __default_sa_restorer /build/glibc-9MGTF6/glibc-2.31/signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67:0
       #4 0x00af91f0 (anonymous namespace)::CommandLineParser::ResetAllOptionOccurrences() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e51f0)
       #5 0x00af8e1c llvm::cl::ResetCommandLineParser() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x4e4e1c)
       #6 0x0077cda0 (anonymous namespace)::CommandLineTest_GroupingAndPrefix_Test::TestBody() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x168da0)
       #7 0x00bc5adc testing::Test::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b1adc)
       #8 0x00bc6cc0 testing::TestInfo::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b2cc0)
       #9 0x00bc7880 testing::TestSuite::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5b3880)
      #10 0x00bd7974 testing::internal::UnitTestImpl::RunAllTests() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c3974)
      #11 0x00bd6ebc testing::UnitTest::Run() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x5c2ebc)
      #12 0x00bb1058 main (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/unittests/Support/./SupportTests+0x59d058)
      #13 0xf78185a4 __libc_start_main /build/glibc-9MGTF6/glibc-2.31/csu/libc-start.c:342:3
      ```
      2e912a2b
    • Dominik Adamski's avatar
      [OMPIRBuilder] Do not call __kmpc_push_num_threads for device parallel (#71934) · f2f5f1bf
      Dominik Adamski authored
      Function __kmpc_push_num_threads should be called only if we specify
      number of threads for host parallel region.
      
      Number of threads specified by the user should be passed as one of
      arguments of __kmpc_parallel_51 function.
      f2f5f1bf
    • lntue's avatar
      [libc][math] Add initial support for C23 float128 math functions, starting... · 3f906f51
      lntue authored
      [libc][math] Add initial support for C23 float128 math functions, starting with copysignf128. (#71731)
      
      3f906f51
    • Amara Emerson's avatar
    • Jerry-Ge's avatar
      [TOSA] Add TosaToMLProgram conversion (#69787) · 6e6352f4
      Jerry-Ge authored
      This patch adds a new pass to lower TOSA StatefulOps to corresponding ML
      Program ops (https://mlir.llvm.org/docs/Dialects/MLProgramOps/
      
      ).
      
      Signed-off-by: default avatarJerry Ge <jerry.ge@arm.com>
      6e6352f4
    • Pablo Antonio Martinez's avatar
      [Docs] Instructions for new contributors to find reviewers (#71936) · beb121f6
      Pablo Antonio Martinez authored
      Right now, the documentation does not clarify what new contributors
      should do to find potential reviewers, since new contributors don't have
      write access and thus cannot select them as explained in the docs.
      
      This patch extends the guidelines for new people, as discussed in
      https://discourse.llvm.org/t/how-to-find-reviewers/74803
      beb121f6
    • yonghong-song's avatar
      [Clang][BPF] Add __BPF_CPU_VERSION__ macro (#71856) · 4e672343
      yonghong-song authored
      Sometimes bpf developer might want to develop different codes
      based on particular cpu versioins. For example, cpu v1/v2/v3
      branch target is 16bit while cpu v4 branch target is 32bit,
      thus cpu v4 allows more aggressive loop unrolling than cpu v1/v2/v3
      (see [1] for a kernel selftest failure due to this).
      We would like to maintain aggressive loop unrolling for cpu v4
      while limit loop unrolling for earlier cpu versions.
      Another example, signed divide also only available with cpu v4.
      
      Actually, adding cpu specific macros are fairly common
      in llvm. For example, x86 has maco like 'i486', '__pentium_mmx__', etc.
      AArch64 has '__ARM_NEON', '__ARM_FEATURE_SVE', etc.
      
      This patch added __BPF_CPU_VERSION__ macro. Current possible values
      are 0/1/2/3/4. The following are the -mcpu=... to __BPF_CPU_VERSION__
      mapping:
      ```
             cpu                  __BPF_CPU_VERSION__
             no -mcpu=<...>       1
             -mcpu=v1             1
             -mcpu=v2             2
             -mcpu=v3             3
             -mcpu=v4             4
             -mcpu=generic        1
             -mcpu=probe          0
      ```
          
      This patch also added some macros for developers to identify some cpu
      insn features:
      ```
            feature macro               enabled in which cpu
            __BPF_FEATURE_JMP_EXT       >= v2
            __BPF_FEATURE_JMP32         >= v3
            __BPF_FEATURE_ALU32         >= v3
            __BPF_FEATURE_LDSX          >= v4
            __BPF_FEATURE_MOVSX         >= v4
            __BPF_FEATURE_BSWAP         >= v4
            __BPF_FEATURE_SDIV_SMOD     >= v4
            __BPF_FEATURE_GOTOL         >= v4
            __BPF_FEATURE_ST            >= v4
      ```    
      [1]
      https://lore.kernel.org/bpf/3e3a8a30-dde0-43a1-981e-2274962780ef@linux.dev/
      4e672343
    • Piotr Zegar's avatar
      [clang-tidy][NFC] Reduce map lookups in IncludeSorter · 8909ff69
      Piotr Zegar authored
      Part of D117460, reduce multiple lookups on map
      in IncludeSorter::addInclude method to one.
      8909ff69
    • Han-Chung Wang's avatar
      [mlir][vector] Take dim sizes into account in DropInnerMostUnitDims. (#71752) · 2bac7201
      Han-Chung Wang authored
      The `stride == 1` does not imply that we can drop it. Because it could
      load more than 1 elements. We should also take source sizes and vector
      sizes into account. Otherwise it generates invalid IRs. E.g.,
      
      ```mlir
      func.func @foo(%arg0: memref<1x1xf32>) -> vector<4x8xf32> {
        %c0 = arith.constant 0 : index
        %cst = arith.constant 0.000000e+00 : f32
        %0 = vector.transfer_read %arg0[%c0, %c0], %cst : memref<1x1xf32>, vector<4x8xf32>
        return %0 : vector<4x8xf32>
      }
      ```
      
      Fixes https://github.com/openxla/iree/issues/15493
      2bac7201
    • Mingming Liu's avatar
      [Support]Look up in top-level subcommand as a fallback when looking options... · b88308b1
      Mingming Liu authored
      [Support]Look up in top-level subcommand as a fallback when looking options for a custom subcommand. (#71776)
      
      **Context:**
      
      - In https://lists.llvm.org/pipermail/llvm-dev/2016-June/101804.html and commit 07670b3e, `cl::SubCommand` is introduced.
      - Options that don't specify subcommand goes into a special 'top level' subcommand.
      
      **Motivating Use Case:**
      - The motivating use case is to refactor `llvm-profdata` to use `cl::SubCommand` to organize subcommands. See
      https://github.com/llvm/llvm-project/pull/71328. A valid use case that's not supported before this patch is shown below
      
      ```
        // show-option{1,2} are associated with 'show' subcommand.
        // top-level-option3 is in top-level subcomand (e.g., `profile-isfs` in SampleProfReader.cpp)
        llvm-profdata show --show-option1 --show-option2 --top-level-option3
      ```
      
      - Before this patch, option handler look-up will fail with the following error message "Unknown command line argument --top-level-option3".
      - After this patch, option handler look-up will look up in sub-command options first, and use top-level subcommand as a fallback, so 'top-level-option3' is parsed correctly.
      b88308b1
    • Joseph Huber's avatar
      [AMDGPU] Call the `FINI_ARRAY` destructors in the correct order (#71815) · a3bd87b1
      Joseph Huber authored
      Summary:
      The AMDGPU backend uses the linker-provided INIT_ARRAY and FINI_ARRAY
      sections to call all the global constructors in a single kernel.
      Previously this mistakenly used the same iteration logic for both
      arrays. The destructors stored in FINI_ARRAY are stored in the same
      order as
      the ones in the INIT_ARRAY section so we need to traverse it in reverse
      order.
      
      Relanding after the revert in fe7b5e2c
      using the IR builder interface instead of ConstantExpr.
      a3bd87b1
    • Alexey Bataev's avatar
    • David Truby's avatar
      [flang][windows] Add option to link against specific MSVC CRT (#70833) · cf1e3420
      David Truby authored
      Currently flang's runtime libraries are only built for the specific CRT
      that LLVM itself was built against. This patch adds the cmake logic for
      building a separate runtime for each CRT configuration and adds a flag
      for selecting a CRT configuration to link against.
      cf1e3420
    • Ilya Biryukov's avatar
      [Sema] Fix strict ordering in overload candidate comparisons · 18a03131
      Ilya Biryukov authored
      This is a follow-up to febf5c97 and
      another instance of #64121.
      
      The added test only fails if Clang is built with libc++ and a enabled
      debug check for strict weak ordering.
      18a03131
    • Nikita Popov's avatar
      Revert "[AMDGPU] Call the `FINI_ARRAY` destructors in the correct order (#71815)" · fe7b5e2c
      Nikita Popov authored
      This reverts commit c1d5865a.
      
      Introduces a new use of ConstantExpr::getAShr().
      fe7b5e2c
  2. Nov 10, 2023