[all-commits] [llvm/llvm-project] 52c28d: clang/OpenCL: Don't use a Function for the block type

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Jan 30 11:03:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52c28d7cf9018f3558268217f6cf91271eb4ac39
      https://github.com/llvm/llvm-project/commit/52c28d7cf9018f3558268217f6cf91271eb4ac39
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.cpp
    M clang/lib/CodeGen/CGOpenCLRuntime.h
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/CodeGen/TargetInfo.h

  Log Message:
  -----------
  clang/OpenCL: Don't use a Function for the block type

The AMDGPU value for this is not really a function. Currently we're
emitting IR that isn't true to what will eventually be emitted.


  Commit: 00f6a7f02f9c8d542ce8ff1c9c037d9fdb421b88
      https://github.com/llvm/llvm-project/commit/00f6a7f02f9c8d542ce8ff1c9c037d9fdb421b88
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl

  Log Message:
  -----------
  clang/OpenCL: Fix not setting convergent on block invoke kernels

Yet another example how convergent not being the default is dangerous
and backwards.


  Commit: d12ee4bf7c14a00b14890fc3042edd659dde7fb2
      https://github.com/llvm/llvm-project/commit/d12ee4bf7c14a00b14890fc3042edd659dde7fb2
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl

  Log Message:
  -----------
  clang/OpenCL: Extend tests for enqueued block attributes

Baseline tests showing that enqueued blocks are not getting the
correct attributes applied.


  Commit: 647925648a0fde06b5b44086843f0d8f164a71df
      https://github.com/llvm/llvm-project/commit/647925648a0fde06b5b44086843f0d8f164a71df
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
    A clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl

  Log Message:
  -----------
  clang/OpenCL: Apply default attributes to enqueued blocks

This was missing important environment context, like denormal-fp-math
and target-features. Curiously this seems to be losing nounwind. Note
this only fixes the actual invoke kernel. The invoke function is
already setting the default attribute set for internal
functions. However that is still buggy since it's not applying any use
function attributes (it's also missing uniform-work-group-size).

There seem to be too many different functions for setting attributes
with inconsistent behavior. The Function overload of
addDefaultFunctionAttributes seems to miss the target-cpu and
target-features. The AttrBuilder one seems to miss optnone (but that
seems to be disallowed on blocks anyway). Neither one calls
setTargetAttributes, when it probably should. uniform-work-group-size
is also set through AMDGPU code when it should be emitting generically
as a language property.

I also noticed update_cc_test_checks for attributes seem to not
connect the captured attribute variables to the attributes at the end
(although I think the numbers happen to work out correctly).


Compare: https://github.com/llvm/llvm-project/compare/516ae48170df...647925648a0f


More information about the All-commits mailing list