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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks. LGTM with minor comments addressed.
lib/Transforms/Scalar/SROA.cpp | ||
---|---|---|
4032 ↗ | (On Diff #44878) | Should we add an |
test/Transforms/SROA/dbg-single-piece.ll | ||
12 ↗ | (On Diff #44878) | 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 ↗ | (On Diff #44878) | checking for the hardcoded !dbg !8 is just asking for trouble :-) |
14 ↗ | (On Diff #44878) | Comment? |
lib/Transforms/Scalar/SROA.cpp | ||
---|---|---|
4032 ↗ | (On Diff #44878) | Sounds reasonable. |
test/Transforms/SROA/dbg-single-piece.ll | ||
12 ↗ | (On Diff #44878) | The problem is that it gets mem2reged so won't be in the final IR. |
13 ↗ | (On Diff #44878) | Yep, sorry. |
14 ↗ | (On Diff #44878) | I have a comment at the very top. Do you want me to move it here? |