Add an IR in unit test directory, which demonstrate the scalarization for struct allocations.
This is added to pave the way for an SROA change to skip scalarization for some cases.
Details
Diff Detail
Event Timeline
llvm/test/Transforms/SROA/alloca-struct.ll | ||
---|---|---|
1 | Please just use auto-update test like in the other tests here |
(disclaimer for the change itself: note that it is not sufficient to check that there are scalar loads/stores, it'd miss the point of SROA.)
Simplify IR by cleaning up alloca instructions for function parameters, and
cleaning up attributes as well as some unused metadata.
It's true. This test is added with the goal to demonstrate how current sroa works, and for a planned patch, it will slightly change the scalarization, so this IR will be updated.
llvm/test/Transforms/SROA/alloca-struct.ll | ||
---|---|---|
1 | Some unit tests run the auto-update while others doesn't (e.g., https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/SROA/fca.ll is not updated by auto-updater) For this IR, using auto-updater inserts quite many checker lines and somewhat hard to read. So will keep the current format. |
lgtm (perhaps change the title of the patch to 'Add new test cases to cover existing SROA behavior'.
Please just use auto-update test like in the other tests here