[all-commits] [llvm/llvm-project] 000279: [NFC][TTI] Introduce getInstructionUniformity API ...

Pankaj Dwivedi via All-commits all-commits at lists.llvm.org
Wed Dec 10 09:44:56 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 000279dcad334bf81ea2e0494f5e12d3564e8a31
      https://github.com/llvm/llvm-project/commit/000279dcad334bf81ea2e0494f5e12d3564e8a31
  Author: Pankaj Dwivedi <pankajkumar.divedi at amd.com>
  Date:   2025-12-10 (Wed, 10 Dec 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Analysis/UniformityAnalysis.cpp
    M llvm/lib/CodeGen/MachineUniformityAnalysis.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
    M llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
    M llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h

  Log Message:
  -----------
  [NFC][TTI] Introduce getInstructionUniformity API for uniformity analysis (#168903)

This patch introduces a new TargetTransformInfo hook
`getInstructionUniformity()`
that provides a unified interface for querying target-specific
uniformity
information about instructions and values.

The new hook returns an `InstructionUniformity` enum with three values:
- Default: Result is uniform if all operands are uniform (standard
propagation)
- AlwaysUniform: Result is always uniform regardless of operands
- NeverUniform: Result can never be assumed uniform

This API wraps the existing `isAlwaysUniform()` and
`isSourceOfDivergence()`
hooks, providing a single entry point for uniformity queries. Both LLVM
IR-level
(via TTI) and MIR-level (via TargetInstrInfo) uniformity analysis have
been
updated to use the new hook.

Target implementations:
- AMDGPU: Wraps existing `isAlwaysUniform()` and
`isSourceOfDivergence()` hooks
- NVPTX: Wraps existing `isSourceOfDivergence()` hook

This is an NFC change - all implementations return conservative defaults
or wrap
existing functionality.

Ref patch:https://github.com/llvm/llvm-project/pull/137639



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