This was suggested in D27855: have the inliner add assumptions, so we don't lose nonnull info provided by argument attributes.
This still doesn't solve PR28430 (dyn_cast), but this gets us closer...
From the use of 'dereferenceable' in the test cases, you can guess that I was drafting an alternate patch that would provide a stronger transfer of the attribute from the callee to the caller, but that would be limited in the same way that D27855 was.
Please let me know if this needs to be disabled by default pending clang fixes.
could be a static variable inside the lambda, that'd reduce the scope.