@@ -5199,6 +5199,7 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
51995199 // Try to compute a friendly type for this partition of the alloca. This
52005200 // won't always succeed, in which case we fall back to a legal integer type
52015201 // or an i8 array of an appropriate size.
5202+ // Returns a tuple: <PartitionType, IsIntegerWideningViable (true if integer widening promotion is used), VectorType (if vector promotion is used, otherwise nullptr)>.
52025203 auto SelectPartitionTy = [&]() -> std::tuple<Type *, bool , VectorType *> {
52035204 // First check if the partition is viable for vetor promotion.
52045205 //
@@ -5275,7 +5276,7 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
52755276 return {ArrayType::get (Type::getInt8Ty (*C), P.size ()), false , nullptr };
52765277 };
52775278
5278- auto [PartitionTy, IsIntegerPromotable , VecTy] = SelectPartitionTy ();
5279+ auto [PartitionTy, IsIntegerWideningViable , VecTy] = SelectPartitionTy ();
52795280
52805281 // Check for the case where we're going to rewrite to a new alloca of the
52815282 // exact same type as the original, and with the same access offsets. In that
@@ -5317,7 +5318,7 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
53175318 SmallSetVector<SelectInst *, 8 > SelectUsers;
53185319
53195320 AllocaSliceRewriter Rewriter (DL, AS, *this , AI, *NewAI, P.beginOffset (),
5320- P.endOffset (), IsIntegerPromotable , VecTy,
5321+ P.endOffset (), IsIntegerWideningViable , VecTy,
53215322 PHIUsers, SelectUsers);
53225323 bool Promotable = true ;
53235324 // Check whether we can have tree-structured merge.
0 commit comments