[all-commits] [llvm/llvm-project] d8f99b: [AMDGPU] replace hostcall module flag with functio...

Sameer Sahasrabuddhe via All-commits all-commits at lists.llvm.org
Fri Feb 11 09:23:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8f99bb6e0641474b6bc1728295b40a8fa279f9a
      https://github.com/llvm/llvm-project/commit/d8f99bb6e0641474b6bc1728295b40a8fa279f9a
  Author: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    R clang/test/CodeGenCUDA/amdgpu-asan-printf.cu
    M clang/test/CodeGenCUDA/amdgpu-asan.cu
    M llvm/lib/Target/AMDGPU/AMDGPUAttributes.def
    M llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
    M llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
    M llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
    M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
    M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
    M llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
    M llvm/test/CodeGen/AMDGPU/addrspacecast-constantexpr.ll
    M llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll
    M llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll
    M llvm/test/CodeGen/AMDGPU/annotate-kernel-features.ll
    M llvm/test/CodeGen/AMDGPU/direct-indirect-call.ll
    M llvm/test/CodeGen/AMDGPU/duplicate-attribute-indirect.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-enqueue-kernel-v3.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-enqueue-kernel.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v3.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args-v5.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-hidden-args.ll
    R llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-absent-v3.ll
    R llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-absent.ll
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-present-v3-asan.ll
    R llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-present-v3.ll
    R llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-present.ll
    A llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-v3.ll
    A llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-v5.ll
    M llvm/test/CodeGen/AMDGPU/propagate-flat-work-group-size.ll
    M llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-attribute-missing.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-multistep.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-nested-function-calls.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-prevent-attribute-propagation.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-recursion-test.ll
    M llvm/test/CodeGen/AMDGPU/uniform-work-group-test.ll
    M mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp

  Log Message:
  -----------
  [AMDGPU] replace hostcall module flag with function attribute

The module flag to indicate use of hostcall is insufficient to catch
all cases where hostcall might be in use by a kernel. This is now
replaced by a function attribute that gets propagated to top-level
kernel functions via their respective call-graph.

If the attribute "amdgpu-no-hostcall-ptr" is absent on a kernel, the
default behaviour is to emit kernel metadata indicating that the
kernel uses the hostcall buffer pointer passed as an implicit
argument.

The attribute may be placed explicitly by the user, or inferred by the
AMDGPU attributor by examining the call-graph. The attribute is
inferred only if the function is not being sanitized, and the
implictarg_ptr does not result in a load of any byte in the hostcall
pointer argument.

Reviewed By: jdoerfert, arsenm, kpyzhov

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




More information about the All-commits mailing list