[all-commits] [llvm/llvm-project] c3a0fc: [libclc] Optimize CLC vector any/all builtins (#12...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Mon Jan 27 08:37:43 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3a0fcc982061f9a69cfc1199dc91bd1fc3158c0
      https://github.com/llvm/llvm-project/commit/c3a0fcc982061f9a69cfc1199dc91bd1fc3158c0
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2025-01-27 (Mon, 27 Jan 2025)

  Changed paths:
    M libclc/clc/lib/generic/relational/clc_all.cl
    M libclc/clc/lib/generic/relational/clc_any.cl

  Log Message:
  -----------
  [libclc] Optimize CLC vector any/all builtins (#124568)

By using the vector reduction buitins we can avoid scalarization.
Targets that don't support vector reductions will scalarize later on
anyway. The vector reduction builtins should be well-enough supported by
the middle-end to be a generic solution.

This produces conceptually equivalent code: all vector elements are
OR'd/AND'd together and the final scalar is bit-shifted and masked to
produce the final result.

The 'normalize' builtin uses 'all' so its code has similarly improved in
places.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list