Skip to content

Commit 92fe65f

Browse files
committed
improvement
1 parent a53896b commit 92fe65f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5258,10 +5258,10 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
52585258
isIntegerWideningViable(P, LargestIntTy, DL))
52595259
return {LargestIntTy, true, nullptr};
52605260

5261-
// If there are only intrinsic users, try to represent as a legal integer
5261+
// If there are only intrinsic users of an aggregate type, try to represent as a legal integer
52625262
// type because we are probably just copying data around and the integer
52635263
// can be promoted.
5264-
if (OnlyIntrinsicUsers && DL.isLegalInteger(P.size() * 8))
5264+
if (OnlyIntrinsicUsers && DL.isLegalInteger(P.size() * 8) && TypePartitionTy->isAggregateType())
52655265
return {
52665266
Type::getIntNTy(*C, P.size() * 8),
52675267
isIntegerWideningViable(P, Type::getIntNTy(*C, P.size() * 8), DL),

0 commit comments

Comments
 (0)