1. Jan 20, 2024
    • Min-Yih Hsu's avatar
      [RISCV] Add support for Smepmp 1.0 (#78489) · 5330daad
      Min-Yih Hsu authored
      Smepmp is a supervisor extension that prevents privileged processes from
      accessing unprivileged program and data.
      
      Spec: https://github.com/riscv/riscv-tee/blob/main/Smepmp/Smepmp.pdf
      5330daad
    • Jeremy Kun's avatar
    • Durgadoss R's avatar
      [LLVM][NVPTX] Add cp.async.bulk.commit/wait intrinsics (#78698) · 43531e71
      Durgadoss R authored
      This patch adds NVVM intrinsics and NVPTX codegen for the bulk variants
      of the async-copy commit/wait instructions.
      lit tests are added to verify the generated PTX.
      
      PTX Doc link:
      
      https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-bulk-commit-group
      
      
      
      Signed-off-by: default avatarDurgadoss R <durgadossr@nvidia.com>
      43531e71
    • Quinn Dawkins's avatar
      [mlir][transform] Add an op for replacing values with function calls (#78398) · 42b16035
      Quinn Dawkins authored
      Adds `transform.func.cast_and_call` that takes a set of inputs and
      outputs and replaces the uses of those outputs with a call to a function
      at a specified insertion point.
      
      The idea with this operation is to allow users to author independent IR
      outside of a to-be-compiled module, and then match and replace a slice
      of the program with a call to the external function.
      
      Additionally adds a mechanism for populating a type converter with a set
      of conversion materialization functions that allow insertion of
      casts on the inputs/outputs to and from the types of the function
      signature.
      42b16035
    • Thurston Dang's avatar
      Re-exec TSan with no ASLR if memory layout is incompatible on Linux (#78351) · 0784b1ee
      Thurston Dang authored
      TSan's shadow mappings only support 30-bits of ASLR entropy on x86
      Linux, and it is not practical to support the maximum of 32-bits (due to pointer compression and the overhead of shadow mappings). Instead, this patch changes TSan to re-exec without ASLR if it encounters an 
      incompatible memory layout, as suggested by Dmitry in
      https://github.com/google/sanitizers/issues/1716.
      If ASLR is already disabled but the memory layout is still incompatible,
      it will abort.
      
      This patch involves a bit of refactoring, because the old code is:
      1. InitializePlatformEarly()
      2. InitializeAllocator()
      3. InitializePlatform(): CheckAndProtect()
      
      but it may already segfault during InitializeAllocator() if the memory
      layout is incompatible, before we get a chance to check in
      CheckAndProtect().
      
      This patch adds CheckAndProtect() during InitializePlatformEarly(), before the allocator is initialized. Naturally, it is necessary to ensure that CheckAndProtect() does *not* allow the heap regions to be occupied  here, hence we generalize CheckAndProtect() to optionally check the heap
      regions. We keep the original behavior of CheckAndProtect() in InitializePlatform() as a last line of defense.
      
      We need to be careful not to prematurely abort if ASLR is disabled but TSan was going to re-exec for other reasons (e.g., unlimited stack size); we implement this by moving all the re-exec logic into ReExecIfNeeded().
      0784b1ee
    • Sam Clegg's avatar
      [lld][WebAssembly] Fix use of undefined funcs under --warn-unresolved-symbols (#78643) · 5b0e45c8
      Sam Clegg authored
      When undefined functions exist in the final link we need to create
      stub functions (otherwise direct calls to those functions could
      not be generated).  We were creating those stub when
      `--unresolved-symbols=ignore-all` was passed but overlooked the fact
      that `--warn-unresolved-symbols` essentially has the same effect (i.e.
      undefined function can exist in the final link).
      
      Fixes: #53987
      5b0e45c8
    • Felipe de Azevedo Piovezan's avatar
      [AsmPrinter][DebugNames] Implement DW_IDX_parent entries (#77457) · b6677835
      Felipe de Azevedo Piovezan authored
      This implements the ideas discussed in [1].
      
      To summarize, this commit changes AsmPrinter so that it outputs
      DW_IDX_parent information for debug_name entries. It will enable
      debuggers to speed up queries for fully qualified types (based on a
      DWARFDeclContext) significantly, as debuggers will no longer need to
      parse the entire CU in order to inspect the parent chain of a DIE.
      Instead, a debugger can simply take the parent DIE offset from the
      accelerator table and peek at its name in the debug_info/debug_str
      sections.
      
      The implementation uses two types of DW_FORM for the DW_IDX_parent
      attribute:
      
      1. DW_FORM_ref4, which points to the accelerator table entry for the
      parent.
      2. DW_FORM_flag_present, when the entry has a parent that is not in the
      table (that is, the parent doesn't have a name, or isn't allowed to be
      in the table as per the DWARF spec). This is space-efficient, since it
      takes 0 bytes.
      
      The implementation works by:
      
      1. Changing how abbreviations are encoded (so that they encode which
      form, if
      any, was used to encode IDX_Parent)
      2. Creating an MCLabel per accelerator table entry, so that they may be
      referred by IDX_parent references.
      
      
      When all patches related to this are merged, we are able to show that
      evaluating an expression such as:
      
      ```
      lldb --batch -o 'b CodeGenFunction::GenerateCode' -o run -o 'expr Fn' -- \
        clang++ -c -g test.cpp -o /dev/null
      ```
      
      is far faster: from ~5000 ms to ~1500ms.
      
      Building llvm-project + clang with and without this patch, and looking
      at its impact on object file size:
      
      ```
      ls -la $(find build_stage2_Debug_idx_parent_assert_dwarf5 -name \*.cpp.o) | awk '{s+=$5}  END {printf "%\047d\n", s}'
      11,507,327,592
      
      -la $(find build_stage2_Debug_no_idx_parent_assert_dwarf5 -name \*.cpp.o) | awk '{s+=$5}  END {printf "%\047d\n", s}'
      11,436,446,616
      ```
      
      That is, an increase of 0.62% in total object file size.
      
      Looking only at debug_names:
      
      ```
      $stage1_build/bin/llvm-objdump --section-headers $(find build_stage2_Debug_idx_parent_assert_dwarf5 -name \*.cpp.o) | grep __debug_names | awk '{s+="0x"$3}  END {printf "%\047d\n", s}'
      440,772,348
      
      $stage1_build/bin/llvm-objdump --section-headers $(find build_stage2_Debug_no_idx_parent_assert_dwarf5 -name \*.cpp.o) | grep __debug_names | awk '{s+="0x"$3}  END {printf "%\047d\n", s}'
      369,867,920
      ```
      
      That is an increase of 19%.
      
      DWARF Linkers need to be changed in order to support this. This commit
      already brings support to "base" linker, but it does not attempt to
      modify the parallel linker. Accelerator entries refer to the
      corresponding DIE offset, and this patch also requires the parent DIE
      offset -- it's not clear how the parallel linker can access this. It may
      be obvious to someone familiar with it, but it would be nice to get help
      from its authors.
      
      [1]:
      https://discourse.llvm.org/t/rfc-improve-dwarf-5-debug-names-type-lookup-parsing-speed/74151/
      b6677835
    • lntue's avatar
      [libc] Add float.h header. (#78737) · c80d68a6
      lntue authored
      c80d68a6
    • Jordan Rupprecht's avatar
      [lldb][test] Apply @expectedFailureAll/@skipIf early for debug_info tests (#73067) · d0d07271
      Jordan Rupprecht authored
      The @expectedFailureAll and @skipIf decorators will mark the test case
      as xfail/skip if _all_ conditions passed in match, including debug_info.
      * If debug_info is not one of the matching conditions, we can
      immediately evaluate the check and decide if it should be decorated.
      * If debug_info *is* present as a match condition, we need to defer
      whether or not to decorate until when the `LLDBTestCaseFactory`
      metaclass expands the test case into its potential variants. This is
      still early enough that the standard `unittest` framework will recognize
      the test as xfail/skip by the time the test actually runs.
      
      TestDecorators exhibits the edge cases more thoroughly. With the
      exception of `@expectedFailureIf` (added by this commit), all those test
      cases pass prior to this commit.
      
      This is a followup to 212a60ec.
      d0d07271
    • Joseph Huber's avatar
      [libc] Fix test failing on GPU using deprecated 'add_unittest' · cebe4de6
      Joseph Huber authored
      Summary:
      We use `add_libc_test' now because it works for both hermetic and unit
      tests. If the test needs to be unit test only you use `UNIT_TEST_ONLY`
      as an argument.
      cebe4de6
    • Marius Brehler's avatar
      [mlir][docs] Fix broken link · 205e15c1
      Marius Brehler authored
      205e15c1
    • Sander de Smalen's avatar
      [AArch64] NFC: Simplify discombobulating 'requiresSMChange' interface (#78703) · 5f41cef5
      Sander de Smalen authored
      Having it return a `std::optional<bool>` is unnecessarily confusing.
      This patch changes it to a simple 'bool'.
      
      This patch also removes the 'BodyOverridesInterface' operand because
      there is only a single use for this which is easily rewritten.
      5f41cef5
    • Sander de Smalen's avatar
      [Clang] Refactor diagnostics for SME builtins. (#78258) · 40a631f4
      Sander de Smalen authored
      The arm_sme.td file was still using `IsSharedZA` and `IsPreservesZA`,
      which should be changed to match the new state attributes added in
      #76971.
      
      This patch adds `IsInZA`, `IsOutZA` and `IsInOutZA` as the state for the
      Clang builtins and fixes up the code in SemaChecking and SveEmitter to
      match.
      
      Note that the code is written in such a way that it can be easily
      extended with ZT0 state (to follow in a future patch).
      40a631f4
  2. Jan 19, 2024