[all-commits] [llvm/llvm-project] 435add: [NVPTX] Revamp NVVMIntrRange pass (#94422)

Alex MacLean via All-commits all-commits at lists.llvm.org
Thu Jun 6 06:43:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 435addbf5088be14b1b7e0398ecd16501dbf4498
      https://github.com/llvm/llvm-project/commit/435addbf5088be14b1b7e0398ecd16501dbf4498
  Author: Alex MacLean <amaclean at nvidia.com>
  Date:   2024-06-06 (Thu, 06 Jun 2024)

  Changed paths:
    M clang/test/CodeGenCUDA/cuda-builtin-vars.cu
    M llvm/lib/Target/NVPTX/NVPTX.h
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    M llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
    M llvm/lib/Target/NVPTX/NVPTXUtilities.cpp
    M llvm/lib/Target/NVPTX/NVPTXUtilities.h
    M llvm/lib/Target/NVPTX/NVVMIntrRange.cpp
    A llvm/test/CodeGen/NVPTX/intr-range.ll
    M llvm/test/CodeGen/NVPTX/intrinsic-old.ll

  Log Message:
  -----------
  [NVPTX] Revamp NVVMIntrRange pass (#94422)

Revamp the NVVMIntrRange pass making the following updates:
- Use range attributes over range metadata. This is what instcombine has
move to for ranges on intrinsics in
https://github.com/llvm/llvm-project/pull/88776 and it seems a bit
cleaner.
- Consider the `!"maxntid{x,y,z}"` and `!"reqntid{x,y,z}"` function
metadata when adding ranges for `tid` srge instrinsics. This can allow
for smaller ranges and more optimization.
- When range attributes are already present, use the intersection of the
old and new range. This complements the metadata change by allowing
ranges to be shrunk when an intrinsic is in a function which is inlined
into a kernel with metadata. While we don't call this more then once
yet, we should consider adding a second call after inlining, once this
has had a chance to soak for a while and no issues have arisen.

I've also re-enabled this pass in the TM, it was disabled years ago due
to "numerical discrepancies" https://reviews.llvm.org/D96166. In our
testing we haven't seen any issues with adding ranges to intrinsics, and
I cannot find any further info about what issues were encountered.



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