In SROA.cpp's canConvertValue() function, it will return "true" if both NewTy and OldTy are ptr type. Probably we need to check whether those two pointers are pointing to the same addr space; otherwise this will trigger an assertion later when SROA tries to create a bitcast between pointers with different addr spaces.
Diff Detail
Event Timeline
lib/Transforms/Scalar/SROA.cpp | ||
---|---|---|
1638–1641 | This line is too long -- can you wrap it to 80 chars? | |
test/Transforms/SROA/address-spaces-1.ll | ||
1 ↗ | (On Diff #55454) | Given that you've filed a PR, it is better to name the test as prXXXX.ll. Also don't use -O3 here -- you should just invoke the pass you're unit testing (SROA in this case). An easy way to do this is to use -print-before-all to get the IR right before SROA crashed. |
13 ↗ | (On Diff #55454) | Can you shrink this test case to be more to the point? |
Note that this patch didn't actually go to the mailing list when you created it, so now the mailing list is missing context on what this patch is even doing. The first email is from Sanjoy.
test/Transforms/SROA/address-spaces-1.ll | ||
---|---|---|
1 ↗ | (On Diff #55454) | Please don't name the file 'prXXXX.ll' or add a new file at all. Naming test files after 'pr....' encourages to have more smaller test files when each file adds substantial overhead. Instead we should be trying to find an existing overarching test file and add the tests to it. Perhaps the 'address-spaces.ll'? |
This line is too long -- can you wrap it to 80 chars?
http://llvm.org/docs/CodingStandards.html#source-code-width