[llvm] [AMDGPU] Fix s_buffer_load crash for illegal result types (PR #215483)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 04:28:52 PDT 2026


================
@@ -10900,6 +10864,32 @@ SDValue SITargetLowering::lowerSBuffer(EVT VT, EVT MemVT, SDLoc DL,
       return Subvector;
     }
 
+    // No SBUFFER_LOAD pattern for this width (i1 is a legal type but still
+    // has none). Load a legal i32/vNi32 carrier and narrow/bitcast down.
+    if ((!isTypeLegal(VT) || VT == MVT::i1) && MemVT == VT) {
----------------
aobolensk wrote:

It shouldn't be, actually. `!isTypeLegal(VT)` also caught i8/i16/vec3 types that have their own faster lowerings. I have replaced it with the explicit list, which is more ugly but more logical in that regard

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


More information about the llvm-commits mailing list