[llvm] [NVPTX] Aggressively try to replace image handles with references (PR #119730)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 13:04:58 PST 2024


================
@@ -55,19 +55,9 @@ NVPTXSubtarget::NVPTXSubtarget(const Triple &TT, const std::string &CPU,
                                const std::string &FS,
                                const NVPTXTargetMachine &TM)
     : NVPTXGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS), PTXVersion(0),
-      FullSmVersion(200), SmVersion(getSmVersion()), TM(TM),
+      FullSmVersion(200), SmVersion(getSmVersion()),
       TLInfo(TM, initializeSubtargetDependencies(CPU, FS)) {}
 
-bool NVPTXSubtarget::hasImageHandles() const {
-  // Enable handles for Kepler+, where CUDA supports indirect surfaces and
-  // textures
-  if (TM.getDrvInterface() == NVPTX::CUDA)
----------------
AlexMaclean wrote:

This isn't actually breaking sm_20 (any more than it already is broken). We're just trying to avoid using image handles in all cases after this change (we used to only do this for sm_20), since references are preferable to handles on newer architectures too, even if handles are supported. 

On a side note, I agree we should deprecate and remove support for older architectures. For reference, I think the minimum supported by nvcc is sm_50.

https://github.com/llvm/llvm-project/pull/119730


More information about the llvm-commits mailing list