[all-commits] [llvm/llvm-project] 9475f6: Reland "[NVPTX] Validate user-specified PTX versio...

Justin Fargnoli via All-commits all-commits at lists.llvm.org
Tue Feb 10 10:12:18 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9475f6af8188c9fb028c25f2143599f7fc3d2bac
      https://github.com/llvm/llvm-project/commit/9475f6af8188c9fb028c25f2143599f7fc3d2bac
  Author: Justin Fargnoli <jfargnoli at nvidia.com>
  Date:   2026-02-10 (Tue, 10 Feb 2026)

  Changed paths:
    M clang/lib/Basic/Targets/NVPTX.cpp
    M clang/lib/Basic/Targets/NVPTX.h
    M clang/lib/Driver/ToolChains/Cuda.cpp
    M clang/test/CodeGen/builtins-nvptx-ptx60.cu
    M clang/test/CodeGen/builtins-nvptx.c
    M clang/test/CodeGen/nvptx_attributes.c
    M clang/test/CodeGenCUDA/convergent.cu
    M clang/test/CodeGenSYCL/kernel-caller-entry-point.cpp
    M clang/test/Driver/cuda-cross-compiling.c
    M clang/test/Driver/cuda-detect.cu
    M clang/test/Driver/openmp-offload-gpu.c
    M clang/test/Headers/gpuintrin.c
    M flang/lib/Frontend/CompilerInstance.cpp
    M flang/test/Lower/OpenMP/target_cpu_features.f90
    M llvm/lib/Target/NVPTX/NVPTX.td
    M llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp
    M llvm/lib/Target/NVPTX/NVPTXSubtarget.h
    M llvm/test/CodeGen/NVPTX/clusterlaunchcontrol-multicast.ll
    M llvm/test/CodeGen/NVPTX/convert-sm100a.ll
    M llvm/test/CodeGen/NVPTX/convert-sm103a.ll
    M llvm/test/CodeGen/NVPTX/f32-ex2.ll
    M llvm/test/CodeGen/NVPTX/fexp2.ll
    M llvm/test/CodeGen/NVPTX/flog2.ll
    M llvm/test/CodeGen/NVPTX/i128.ll
    M llvm/test/CodeGen/NVPTX/nvvm-reflect-arch-O0.ll
    A llvm/test/CodeGen/NVPTX/ptx-version-validation.ll
    M llvm/test/CodeGen/NVPTX/rsqrt.ll
    M llvm/test/CodeGen/NVPTX/sm-version.ll
    M llvm/test/CodeGen/NVPTX/surf-tex.py
    R llvm/test/CodeGen/NVPTX/wmma-ptx86-sm120a.py
    M mlir/include/mlir/Dialect/GPU/Pipelines/Passes.h
    M mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
    M mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td

  Log Message:
  -----------
  Reland "[NVPTX] Validate user-specified PTX version against SM version" (#180116)

Previous commit message: 

>Previous commit message: 
>
>> Original commit message:
>>
>>>When users explicitly specify a PTX version via -mattr=+ptxNN that's
insufficient for their target SM, we now emit a fatal error. Previously,
we silently upgraded the PTX version to the minimum required for the
target SM.
>>>
>>>When no SM or PTX version is specified, we now use PTX 3.2 (the
minimum for the default SM 3.0) instead of PTX 6.0.
>>
>>The following commits should fix the failures that arose when I
previously tried to land this commit:
>>
>>

>>https://github.com/llvm/llvm-project/commit/9fc5fd0ad689eed94f65b1d6d10f9c5642935e68
should address the llvm-nvptx*-nvidia-* build failures:
https://github.com/llvm/llvm-project/pull/174834#issuecomment-3742242651
>>
>>

>>https://github.com/llvm/llvm-project/commit/600514a63760c6730e4cd970d2fcead9c5a897b3
should address the MLIR failures
>
>The previous commit was reverted with
https://github.com/llvm/llvm-project/commit/d23cb79ba497281de050ef609cb91b91058bf323
because the
[mlir-nvidia](https://lab.llvm.org/buildbot/#/builders/138/builds/24797)
and
[mlir-nvidia-gcc7](https://lab.llvm.org/buildbot/#/builders/116/builds/23929)
Buildbots were failing.
>
>Those tests failed because MLIR's default SM was 5.0, which caused
NVPTX
to target PTX ISA v4.0, which did not support the intrinsics used in the
failing tests.
>

>https://github.com/llvm/llvm-project/commit/243f011577193c99358ccc4142b296d4fa80ea11
should address this by bumping MLIR's default SM to 7.5. Now, using
MLIR's new default SM, NVPTX
targets the PTX ISA v6.3, which supports the intrinsics used in the
failing tests.

---

The previous commit was reverted with
e9b578a4d77025e18318efedd0f3f3764338d859
[because](https://github.com/llvm/llvm-project/pull/179304#issuecomment-3856301333)
the clang driver set the default PTX ISA version to v4.2 when no CUDA
installation is found. However, given our patch, we should not set a
default; instead, let the LLVM backend select the appropriate PTX ISA
version for the target SM.



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