From 0a7f4e03a9a19d3b48190b982b707036d95d99f5 Mon Sep 17 00:00:00 2001 From: Douglas Yung Date: Fri, 23 Sep 2022 11:23:51 -0700 Subject: [PATCH] Revert "[SROA] Check typeSizeEqualsStoreSize in isVectorPromotionViable" This reverts commit 3f08d248c44c744deda38423409b86720822739e. The commit this change is fixing is being reverted due to GHI #57796 and #37821, so revert this commit as well. --- llvm/lib/Transforms/Scalar/SROA.cpp | 2 -- llvm/test/Transforms/SROA/vector-promotion.ll | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index e86dcfe..4983273 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -1933,8 +1933,6 @@ static VectorType *isVectorPromotionViable(Partition &P, const DataLayout &DL) { continue; if (isa(Ty)) continue; - if (!DL.typeSizeEqualsStoreSize(Ty)) - continue; // Create Vector with size of V, and each element of type Ty VectorType *V = CandidateTys[0]; uint64_t ElementSize = DL.getTypeStoreSizeInBits(Ty).getFixedSize(); diff --git a/llvm/test/Transforms/SROA/vector-promotion.ll b/llvm/test/Transforms/SROA/vector-promotion.ll index 30d5248..7ad8e5c 100644 --- a/llvm/test/Transforms/SROA/vector-promotion.ll +++ b/llvm/test/Transforms/SROA/vector-promotion.ll @@ -628,19 +628,3 @@ entry: %add2 = add i32 %add, %add1 ret i32 %add2 } - -; This used to hit an assert after commit de3445e0ef15c4. -; Added as regression test to verify that we handle this without crashing. -define i1 @test15() { -; CHECK-LABEL: @test15( -; CHECK-NEXT: [[A_SROA_0:%.*]] = alloca <2 x i64>, align 32 -; CHECK-NEXT: store <2 x i64> , ptr [[A_SROA_0]], align 32 -; CHECK-NEXT: [[A_SROA_0_0_A_SROA_0_0_L:%.*]] = load i1, ptr [[A_SROA_0]], align 32 -; CHECK-NEXT: ret i1 [[A_SROA_0_0_A_SROA_0_0_L]] -; - %a = alloca <8 x i32> - store <2 x i64> , ptr %a - %l = load i1, ptr %a, align 1 - ret i1 %l - -} -- 2.7.4