1. Aug 29, 2023
    • Anton Rydahl's avatar
      [OpenMP] Change OpenMP default version in documentation and help text for -fopenmp-version · c1b5674f
      Anton Rydahl authored
      As discussed on the weekly OpenMP meeting on the second of August 2023, the default version
      in the OpenMP documentation shoud be changed from OpenMP 5.0 to 5.1.
      
      Differential Revision: https://reviews.llvm.org/D156901
      c1b5674f
    • Yingwei Zheng's avatar
      446f3c23
    • Phoebe Wang's avatar
      [X86][BF16] Add test coverage for AVX-NE-CONVERT · 30ec9473
      Phoebe Wang authored
      Split from D158952.
      30ec9473
    • Shoaib Meenai's avatar
      [driver] Refactor getRuntimePaths. NFC · b6a1473f
      Shoaib Meenai authored
      This used to be getRuntimePath till https://reviews.llvm.org/D115049
      added a fallback search path for Android. As far as I can tell, the
      intent has always been to use the first existing path though instead of
      actually supporting multiple runtime paths. We can move the existence
      checks into getRuntimePath and have it return std::optional, which also
      makes the `--print-runtime-dir` behavior much cleaner.
      
      The motivation is a follow-up change to Android runtime path searches,
      which is much nicer with this in place.
      
      Reviewed By: phosek, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D158475
      b6a1473f
    • Shoaib Meenai's avatar
      [compiler-rt] Remove explicit Android libatomic linking · dcafbd0c
      Shoaib Meenai authored
      The comments date back to NDK r10, which is ancient. libatomic isn't
      always needed anymore, and even when it is, it's bundled into
      compiler-rt in the NDK so we'll get it automatically. Remove the
      unnecessary explicit links.
      
      Reviewed By: srhines
      
      Differential Revision: https://reviews.llvm.org/D158793
      dcafbd0c
    • Shoaib Meenai's avatar
      [compiler-rt] Improve defaults for Android · cf403c10
      Shoaib Meenai authored
      Android has only used libc++ for a long time, and since NDK r23, it
      also always uses compiler-rt and LLVM's libunwind (which is linked
      statically). Reflect these defaults in compiler-rt's build, instead of
      requiring the correct settings to always be externally specified.
      
      Reviewed By: srhines
      
      Differential Revision: https://reviews.llvm.org/D158792
      cf403c10
    • Shoaib Meenai's avatar
      [libcxxabi] Automatically use static libunwind when required · 3789c236
      Shoaib Meenai authored
      If we attempt to use unwind_shared when LIBUNWIND_ENABLE_SHARED is OFF,
      we'll get link errors. LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY
      avoids that, but it seems redundant to have to specify it manually.
      Automatically switch libunwind statically when its shared build is
      disabled, which also matches compiler-rt [1].
      
      [1] https://github.com/llvm/llvm-project/blob/71bfec762bd970e7834f58c158ddc15f93402d7a/compiler-rt/CMakeLists.txt#L238-L240
      
      Reviewed By: #libc_abi, phosek
      
      Differential Revision: https://reviews.llvm.org/D158789
      3789c236
    • Kai Sasaki's avatar
      [mlir][complex] Convert complex.abs to arith with fastmath flag · 2e53e154
      Kai Sasaki authored
      This reverts commit 8e946fec after
      restoring the test-pbp.exe file.
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D158692
      2e53e154
    • Matt Arsenault's avatar
    • Matt Arsenault's avatar
      IR: Add operator | and & for FastMathFlags · 033d6ffb
      Matt Arsenault authored
      We only had |= and &= which was annoying.
      033d6ffb
    • Leonard Chan's avatar
      [sanitizer] Consolidate some LowLevelAllocators to one · afd170bd
      Leonard Chan authored
      This removes and replaces usage of a few LowLevelAllocators with a single one
      provided by sanitizer_common. Functionally, there should be no difference
      between using different allocators vs the same one. This works really well
      with D158783 which controls the size of each allocator mmap to significantly
      reduce fragmentation.
      
      This doesn't remove them all, mainly the ones used by asan and the flag parser.
      
      Differential Revision: https://reviews.llvm.org/D158786
      afd170bd
    • Leonard Chan's avatar
      [sanitizer] Set the min size to allocate for the LowLevelAllocator to · 56006757
      Leonard Chan authored
      65536 bytes
      
      The LowLevelAllocator is a helper class used by many sanitizer internals
      for anonymously mmaping stuff. The allocator (usually) maps one page at
      a time, but this can lead to a lot of fragmentation if the allocator is
      heavily used. The flag parser is an example of this where it needs to do
      lots of string copying that need to exist for a variable length of time.
      
      This adds a macro for specifying the number of pages the LowLevelAllocator
      can make at a time, which locally I've found to significantly help reduce
      fragmentation and help run the scudo allocator tests in an asan-instrumented
      build on riscv Sv39. This is a static macro rather than a value that could
      be provided via an env variable because flag parsing is one of the earliest
      consumers of the LowLevelAllocator, so this should be set before its ever used.
      
      Note this will mainly help instances of the LowLevelAllocator that are heavily
      used, but instances of the LowLevelAllocator that do a small fixed number
      of allocations won't benefit as much from this. This can be alleviated though
      if we instead consolidate all of them to one single LowLevelAllocator (D158786).
      
      Differential Revision: https://reviews.llvm.org/D158783
      56006757
    • William Huang's avatar
      [llvm-profdata] Use std::unordered_map in SampleProfileMap · 33810543
      William Huang authored
      Patch D147740 Change back to std::unordered_map for SampleProfileMap because it has reference validity, the change to use llvm::DenseMap is moved to a different patch.
      
      Reviewed By: wenlei, ayermolo
      
      Differential Revision: https://reviews.llvm.org/D159014
      33810543
    • Jennifer Yu's avatar
      [MSABI] Remove comdat attribute for inheriting ctor. · 1d0bd8e5
      Jennifer Yu authored
      Currently, for MS, the linkage for the inheriting constructors is set to
      internal.  However, the comdat attribute is also set like:
      
      define internal noundef ptr @"??0?$B@_N@@qeaa@AEBVF@@aebua@@@z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) unnamed_addr comdat
      
      This could cause linker to fail.
      
      The change is to remove comdat attribute for the inheriting constructor
      to make linker happy.
      
      Differential Revision: https://reviews.llvm.org/D158538
      1d0bd8e5
    • Chia-hung Duan's avatar
      [scudo] Add SCUDO_ENABLE_HOOKS to enable hooks at compilation time · 88852964
      Chia-hung Duan authored
      Accessing the PLT entries of hooks can lead a certain amount of
      performance overhead. This is observed on certain tasks which will do a
      bunch of malloc/free and their throughputs are impacted by the null
      check of hooks.
      
      Also add SCUDO_ENABLE_HOOKS_TESTS to select if we want to run the hook
      tests. On some platforms they may have different ways to run the
      wrappers tests (end-to-end tests) and test the hooks along with the
      wrappers tests may not be feasible. Provide an option to turn it ON/OFF.
      
      By default, we only verify the hook behavior in the scudo standalone
      tests if SCUDO_ENABLE_HOOKS is defined or COMPILER_RT_DEBUG is true.
      
      Reviewed By: cferris, fabio-d
      
      Differential Revision: https://reviews.llvm.org/D158784
      88852964
    • walter erquinigo's avatar
      [LLDB] Fix tab size settings tests · bc0b5699
      walter erquinigo authored
      They were reported in https://lab.llvm.org/buildbot/#/builders/68/builds/58956 and the fix is simple.
      bc0b5699
    • Daniel Hoekwater's avatar
      [CodeGen][AArch64] Don't split jump table basic blocks · ef1c25eb
      Daniel Hoekwater authored
      Jump tables on AArch64 are label-relative rather than table-relative, so
      having jump table destinations that are in different sections causes
      problems with relocation. Jump table lookups have a max range of 1MB, so
      all destinations must be in the same section as the lookup code. Both of
      these restrictions can be mitigated with some careful and complex logic,
      but doing so doesn't gain a huge performance benefit.
      
      Efficiently ensuring jump tables are correct and can be compressed on
      AArch64 is a TODO item. In the meantime, don't split blocks that can
      cause problems.
      
      Differential Revision: https://reviews.llvm.org/D157124
      ef1c25eb
    • walter erquinigo's avatar
      [LLDB][REPL] Change the default tab size · 47aca756
      walter erquinigo authored
      The REPL has a default tab size of 4 spaces, which seems to be a bit too much. The reason is that the REPL transforms tabs into spaces, and therefore whenever you want to manually deindent, you need to delete at least 4 characters. On the other hand, using 2 as default results in less keystrokes, without hurting readability.
      47aca756
    • Peter Klausler's avatar
      [flang] INQUIRE(FILE=path, READ/READWRITE/WRITE=x) should be UNKNOWN when unknown · 7db0610c
      Peter Klausler authored
      For nonexistent or inaccessible files, we're returning NO, which is
      indeed true, but we should return UNKNOWN instead.
      
      Differential Revision: https://reviews.llvm.org/D158653
      7db0610c
    • Wu, Yingcong's avatar
      [fuzzer,CMake] Group fuzzer lit test into one check-fuzzer · 9c0302a7
      Wu, Yingcong authored
      For now check-fuzzer is just a cmake target that depends
      on different check-fuzzer-xxx lit test targets. This causes
      check-fuzzer get seperate lit test results like this:
      
      ```
      ********************
      ********************
      Failed Tests (1):
        libFuzzer :: fuzzer-flags.test
      
      Testing Time: 19.80s
        Unsupported      :   7
        Passed           : 128
        Expectedly Failed:   3
        Failed           :   1
      make[3]: *** [projects/compiler-rt/test/fuzzer/CMakeFiles/check-fuzzer-default-x86_64.dir/build.make:71: projects/compiler-rt/test/fuzzer/CMakeFiles/check-fuzzer-default-x86_64] Error 1
      make[2]: *** [CMakeFiles/Makefile2:36745: projects/compiler-rt/test/fuzzer/CMakeFiles/check-fuzzer-default-x86_64.dir/all] Error 2
      make[2]: *** Waiting for unfinished jobs....
      --
      
      ********************
      ********************
      Failed Tests (1):
        libFuzzer :: fuzzer-flags.test
      
      Testing Time: 24.33s
        Unsupported:  21
        Passed     : 117
        Failed     :   1
      make[3]: *** [projects/compiler-...
      9c0302a7
    • Amy Huang's avatar
      [llvm-rc] Continue to use Argv[0] to resolve executable path · e4eb8d97
      Amy Huang authored
      In internal google builds, MainExecPath doesn't go to the directory with `clang`.
      Fall back to using Argv0 if MainExecPath doesn't find any clangs.
      
      Differential Revision: https://reviews.llvm.org/D158901
      e4eb8d97
    • Wu, Yingcong's avatar
      [fuzzer,CMake] Add config name for fuzzer lit test · ed5acb14
      Wu, Yingcong authored
      Add config name for fuzzer lit test, to make it easier to identify failures are with which config.
      
      Before this change, same lit tests with different configs will share the same test name.
      ```
      ********************
      Failed Tests (2):
        libFuzzer :: fuzzer-flags.test
        libFuzzer :: fuzzer-flags.test
      ```
      Actually this is a failure of two lit tests(two configs of the same test).
      
      With this change, the names will be different.
      ```
      ********************
      Failed Tests (2):
        libFuzzer-i386-default-Linux ::fuzzer-flags.test
        libFuzzer-x86_64-default-Linux :: fuzzer-flags.test
      ```
      
      Reviewed By: MaskRay, vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D158696
      ed5acb14
    • Logan Chien's avatar
      [mlir] Enable DRR variadic operand matching · 08d7377b
      Logan Chien authored
      This commit enables DRR rewriter to match a fixed number of sub-operands
      as a variadic operand.
      
      Differential Review: https://reviews.llvm.org/D157359
      08d7377b
    • Muhammad Omair Javaid's avatar
      Revert "[mlir][complex] Convert complex.abs to arith with fastmath flag" · 8e946fec
      Muhammad Omair Javaid authored
      This reverts commit 653f7769.
      
      This breaks lldb-aarch64-windows buildbot.
      I have reproduced the issue on x86_64 Windows as well.
      https://lab.llvm.org/buildbot/#/builders/219/builds/5130
      8e946fec
    • Martin Storsjö's avatar
      [compiler-rt] [test] Adjust an XFAIL for strtoll_strict.c for MinGW targets · 277fc947
      Martin Storsjö authored
      80332312 made this test pass
      in MinGW environments, even if it still is failing in MSVC
      environments.
      277fc947
    • Fangrui Song's avatar
      [Driver,X86] Ignore -mfpmath= for assembler input · 081afa3d
      Fangrui Song authored
      Some options are only claimed in AddX86TargetArgs/etc (called by
      Clang::RenderTargetOptions).
      For assembler input, `Add*TargetArgs` is not called. If an option is
      unclaimed, it either leads to a -Wunused-command-line-argument warning
      or an error (if `TargetSpecific` is set)
      ```
      // clang '-###' --target=x86_64 -mfpmath=sse -c a.s
      clang: error: unsupported option '-mfpmath=sse' for target 'x86_64'
      ```
      
      For -mfpmath=, it's actually claimed by RenderFloatingPointOptions,
      which should be moved to AddARMTargetArgs/AddX86TargetArgs later
      (non-AArch32-non-x86 targets give a frontend error).
      This change is localized and similar to D153691, for release/17.x
      backporting.
      
      Fix https://github.com/llvm/llvm-project/issues/65023
      
      Reviewed By: thesamesam
      
      Differential Revision: https://reviews.llvm.org/D159010
      081afa3d
    • Zequan Wu's avatar
      [Profile] Allow online merging with debug info correlation. · f52f8e81
      Zequan Wu authored
      When using debug info correlation, value profiling needs to be switched off.
      So, we are only merging counter sections. In that case the existance of data
      section is just used to provide an extra check in case of corrupted profile.
      
      This patch performs counter merging by iterating the counter section by counter
      size and add them together.
      
      Reviewed By: ellis, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D157632
      f52f8e81
    • LLVM GN Syncbot's avatar
      [gn build] Port 79af92bb · 92ed1e0d
      LLVM GN Syncbot authored
      92ed1e0d
    • Jan Svoboda's avatar
      [llvm][clang][modules] Fix test failure on big-endian bots · dd850f0b
      Jan Svoboda authored
      After 6fb08d8f,`clang/test/Modules/ModuleDebugInfoDwoId.cpp` started failing on a number of big-endian build bots (clang-ppc64be-linux-multistage, clang-ppc64be-linux-test-suite). This patch attempts to fix that by creating an API on `llvm::BitstreamWriter` that allows backpatching individual bytes. This API is then used from `clang::ASTWriter` to avoid endianness mismatch.
      dd850f0b
    • Fred Fu's avatar
      Reland "[clang-repl] support code completion at a REPL." · 79af92bb
      Fred Fu authored
      Original commit message:
      "
      This patch enabled code completion for ClangREPL. The feature was built upon
      three existing Clang components: a list completer for LineEditor, a
      CompletionConsumer from SemaCodeCompletion, and the ASTUnit::codeComplete method.
      The first component serves as the main entry point of handling interactive inputs.
      
      Because a completion point for a compiler instance has to be unchanged once it
      is set, an incremental compiler instance is created for each code
      completion. Such a compiler instance carries over AST context source from the
      main interpreter compiler in order to obtain declarations or bindings from
      previous input in the same REPL session.
      
      The most important API codeComplete in Interpreter/CodeCompletion is a thin
      wrapper that calls with ASTUnit::codeComplete with necessary arguments, such as
      a code completion point and a ReplCompletionConsumer, which communicates
      completion results from SemaCodeCompletion back to the list completer for the
      REPL.
      
      In addition, PCC_TopLevelOrExpression and CCC_TopLevelOrExpression` top levels
      were added so that SemaCodeCompletion can treat top level statements like
      expression statements at the REPL. For example,
      
      clang-repl> int foo = 42;
      clang-repl> f<tab>
      
      From a parser's persective, the cursor is at a top level. If we used code
      completion without any changes, PCC_Namespace would be supplied to
      Sema::CodeCompleteOrdinaryName, and thus the completion results would not
      include foo.
      
      Currently, the way we use PCC_TopLevelOrExpression and
      CCC_TopLevelOrExpression is no different from the way we use PCC_Statement
      and CCC_Statement respectively.
      
      Differential revision: https://reviews.llvm.org/D154382
      "
      
      The new patch also fixes clangd and several memory issues that the bots reported
      and upload the missing files.
      79af92bb
    • Vassil Vassilev's avatar
      Revert "Reland "[clang-repl] support code completion at a REPL."" · 752f87cd
      Vassil Vassilev authored
      This reverts commit 5ab25a42 due to forgotten
      files.
      752f87cd
    • Vitaly Buka's avatar
    • Fred Fu's avatar
      Reland "[clang-repl] support code completion at a REPL." · 5ab25a42
      Fred Fu authored
      Original commit message:
      "
      This patch enabled code completion for ClangREPL. The feature was built upon
      three existing Clang components: a list completer for LineEditor, a
      CompletionConsumer from SemaCodeCompletion, and the ASTUnit::codeComplete method.
      The first component serves as the main entry point of handling interactive inputs.
      
      Because a completion point for a compiler instance has to be unchanged once it
      is set, an incremental compiler instance is created for each code
      completion. Such a compiler instance carries over AST context source from the
      main interpreter compiler in order to obtain declarations or bindings from
      previous input in the same REPL session.
      
      The most important API codeComplete in Interpreter/CodeCompletion is a thin
      wrapper that calls with ASTUnit::codeComplete with necessary arguments, such as
      a code completion point and a ReplCompletionConsumer, which communicates
      completion results from SemaCodeCompletion back to the list completer for the
      REPL.
      
      In addition, PCC_TopLevelOrExpression and CCC_TopLevelOrExpression` top levels
      were added so that SemaCodeCompletion can treat top level statements like
      expression statements at the REPL. For example,
      
      clang-repl> int foo = 42;
      clang-repl> f<tab>
      
      From a parser's persective, the cursor is at a top level. If we used code
      completion without any changes, PCC_Namespace would be supplied to
      Sema::CodeCompleteOrdinaryName, and thus the completion results would not
      include foo.
      
      Currently, the way we use PCC_TopLevelOrExpression and
      CCC_TopLevelOrExpression is no different from the way we use PCC_Statement
      and CCC_Statement respectively.
      
      Differential revision: https://reviews.llvm.org/D154382
      "
      
      The new patch also fixes clangd and several memory issues that the bots reported.
      5ab25a42
    • MasterCopy8GB's avatar
      [clang-tidy][readability] add Leading_upper_snake_case · f0e2a5e2
      MasterCopy8GB authored
      Add Leading_upper_snake_case to IdentifierNamingCheck naming convention.
      
      Fixes: #42451
      
      Reviewed By: PiotrZSL
      
      Differential Revision: https://reviews.llvm.org/D158787
      f0e2a5e2
    • Piotr Zegar's avatar
      [clang-tidy][NFC] Relase notes for modernize-use-std-print · 6e2d94a4
      Piotr Zegar authored
      Update release notes for modernize-use-std-print check.
      Post D156616 action.
      6e2d94a4
    • Mike Crowe's avatar
      [clang-tidy] Fix c_str() removal and cast addition when re-ordering arguments · c6207f6e
      Mike Crowe authored
      The modernize-use-std-print check would get confused if it had to
      re-order field-width and precision arguments at the same time as adding
      casts or removing calls to c_str().
      
      Fix this by tracking the argument indices and combining c_str() removal
      with argument re-ordering. Add missing test cases to lit check.
      
      Fixes https://github.com/llvm/llvm-project/issues/64033
      
      Reviewed By: PiotrZSL
      
      Differential Revision: https://reviews.llvm.org/D156616
      c6207f6e
    • Alex Voicu's avatar
      [Clang][CodeGen] `typeid` needs special care when `type_info` is not in the default AS · 9c760ca8
      Alex Voicu authored
      After https://reviews.llvm.org/D153092, for targets that use a non-default AS for globals, an "interesting" situation arises around typeid and its paired type, type_info:
      
      - on the AST level, the type_info interface is defined with default / generic addresses, be it for function arguments, or for this;
      - in IR, type_info values are globals, and thus pointers to type_info values are pointers to global
      
      This leads to a mismatch between the function signature / formal type of the argument, and its actual type. Currently we try to handle such mismatches via `bitcast`, but that is wrong in this case, since an `ascast` is required. This patch ensures that iff the pointer to `type_info` points to a non-default AS, an ascast is inserted so as to match the `typeid` interface / return value type.
      
      Reviewed by: yaxunl
      
      Differential Revision: https://reviews.llvm.org/D157452
      9c760ca8
    • Vitaly Buka's avatar
      Revert "[Fuzzer] SetThreadName implementation for Windows" · dd3aa26f
      Vitaly Buka authored
      Fails with "The procedure entry point SetThreadDescription could not be located in the dynamic link library..."
      
      This reverts commit cf76ddcb.
      dd3aa26f
    • Vitaly Buka's avatar
      151e33c7
    • Vitaly Buka's avatar
      45eb6026