If SROA creates only one piece (e.g. because the other is not needed), it still needs to create a bit_piece expression if that bit piece is smaller than the original size of the alloca.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Thanks. LGTM with minor comments addressed.
| lib/Transforms/Scalar/SROA.cpp | ||
|---|---|---|
| 4032 | Should we add an | |
| test/Transforms/SROA/dbg-single-piece.ll | ||
| 12 | I think we should also check for the sroa'd alloca and verify that its size matches the size of the OP_bit_piece. | |
| 13 | checking for the hardcoded !dbg !8 is just asking for trouble :-) | |
| 14 | Comment? | |
Should we add an
} else assert(Pieces.size() == 1&& "partition is as large as original alloca")
?