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.
The code looks fine, have a few minor nits on the test case.
|1 ↗||(On Diff #55608)|
@chandlerc 's suggestion of putting this in address-spaces.ll still stands. To make the PR number obvious, I'd suggest renaming @testKernel to @pr27557 instead.
|3 ↗||(On Diff #55608)|
You can probably remove the ModuleID bit.
|11 ↗||(On Diff #55608)|
These show up inside the the optimized testKernel, right? If so, I'd suggest:
; CHECK-LABEL: @testKernel( < your CHECK: lines >