[all-commits] [llvm/llvm-project] a888e4: [IR] Memory intrinsics are not unconditionally `no...

Nicolai Hähnle via All-commits all-commits at lists.llvm.org
Thu May 20 18:41:26 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a888e492f601644f44b843373039966e7acacd31
      https://github.com/llvm/llvm-project/commit/a888e492f601644f44b843373039966e7acacd31
  Author: Nicolai Hähnle <nhaehnle at gmail.com>
  Date:   2021-05-21 (Fri, 21 May 2021)

  Changed paths:
    M llvm/include/llvm/IR/Intrinsics.td
    M llvm/test/Analysis/BasicAA/cs-cs.ll
    M llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
    M llvm/test/CodeGen/AMDGPU/addrspacecast-constantexpr.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
    M llvm/test/Transforms/Attributor/heap_to_stack.ll
    M llvm/test/Transforms/Attributor/lowerheap.ll
    M llvm/test/Transforms/Attributor/nosync.ll
    M llvm/test/Transforms/DeadStoreElimination/multiblock-malloc-free.ll
    M llvm/test/Transforms/MemCpyOpt/memcpy.ll
    M llvm/test/Transforms/ObjCARC/nested.ll

  Log Message:
  -----------
  [IR] Memory intrinsics are not unconditionally `nosync`

Remove the `nosync` attribute from the memory intrinsic definitions
(i.e. memset, memcpy, memmove).

Like native memory accesses, memory intrinsics can be volatile. This is
indicated by an immarg in the intrinsic call. All else equal, a volatile
memory intrinsic is `sync`, so we cannot annotate the intrinsic functions
themselves as `nosync`. The attributor and function-attr passes know to
take the volatile bit into account.

Since `nosync` is a default attribute, this means we have to stop using
the DefaultAttrIntrinsic tablegen class for memory intrinsics, and
specify all default attributes other than `nosync` explicitly.

Most of the test changes are trivial churn, but one test case
(in nosync.ll) was in fact incorrect before this change.

Differential Revision: https://reviews.llvm.org/D102295




More information about the All-commits mailing list