[all-commits] [llvm/llvm-project] f9c0cf: [mlir][spirv] Lower math.ctlz to OpenCL.std clz fo...

Levin Dabhi via All-commits all-commits at lists.llvm.org
Wed May 6 01:22:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9c0cf57d3339636a9aeeb0d4746de0659636e0b
      https://github.com/llvm/llvm-project/commit/f9c0cf57d3339636a9aeeb0d4746de0659636e0b
  Author: Levin Dabhi <ldabhi at qti.qualcomm.com>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    M mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
    M mlir/test/Conversion/MathToSPIRV/math-to-opencl-spirv.mlir

  Log Message:
  -----------
  [mlir][spirv] Lower math.ctlz to OpenCL.std clz for Kernel targets (#195470)

Lower `math.ctlz` to `spirv.CL.Clz` for targets with Kernel capability.
Shader targets keep the existing GLSL-based fallback implemented via
`spirv.GL.FindUMsb`.

Previously, `math.ctlz` was lowered through the GLSL path using
`spirv.GL.FindUMsb` plus additional SPIR-V ops. That worked for Shader
targets, but failed legalization for OpenCL/Kernel targets where Shader
capability is not supported.



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