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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 02:47:26 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.typeSizeEqualsStoreSize(AccessTy))
----------------
arsenm wrote:

Given you directly use getTypeStoreSize below, I'd reuse that variable and directly check 

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


More information about the llvm-commits mailing list