This can happen when the rest of the members of are zero length. Following the same pattern applied to the SROA pass in:
d7f6f1636d53c3e2faf55cdf20fbb44a1a149df1
Details
Diff Detail
Unit Tests
Event Timeline
Thanks! I can confirm that I do not see a crash anymore with the config I used when initially reporting. I will try to run this patch through all of my kernel build tests this afternoon to make sure nothing else has regressed.
I am not an expert in this area by any means so I don't feel confident reviewing or approving the patch.
llvm/lib/Transforms/IPO/GlobalOpt.cpp | ||
---|---|---|
479 | Should this be: If we don't have a size, then !VarSize is true, and we proceed to emit a fragment? Seems in juxtaposition with the comment? | |
llvm/test/DebugInfo/Generic/global-sra-struct-zero-length.ll | ||
75 | Is there maybe some of this debug info that's irrelevant and could be cleaned up to help make the test case more concise? |
llvm/lib/Transforms/IPO/GlobalOpt.cpp | ||
---|---|---|
478 | // If the FragmentSize is smaller than the variable, emit a fragment expression. // If the variable size is unknown a fragment must be emitted to be safe. Otherwise this raises more questions. | |
llvm/test/DebugInfo/Generic/global-sra-struct-zero-length.ll | ||
2 | please explain what is being tested in this test. | |
40 | please try to remove all non-essential attributes from the test. |
- Fixed comments as suggested
- Added comment to explain purpose of test case
- Removed unimportant info from the test case
@nathanchance Post back here or on the Bugzilla issue if you continue to see failures.
Otherwise this raises more questions.