[llvm] [AMDGPU] Avoid crashes for non-byte-sized types in PromoteAlloca (PR #134042)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 04:30:19 PDT 2025


================
@@ -728,6 +728,11 @@ static bool isSupportedAccessType(FixedVectorType *VecTy, Type *AccessTy,
   // We could handle more complicated cases, but it'd make things a lot more
   // complicated.
   if (isa<FixedVectorType>(AccessTy)) {
+    // If the type size and the store size don't match, we would need to do more
+    // than just bitcast to translate between an extracted/insertable subvectors
+    // and the accessed value.
+    if (DL.getTypeStoreSizeInBits(AccessTy) != DL.getTypeSizeInBits(AccessTy))
+      return false;
----------------
arsenm wrote:

These are immediately queried again below 

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


More information about the llvm-commits mailing list