[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type

The included test case currently crashes on tip of tree. Rather than adding a bailout, I chose to restructure the code so that the existing helper function could be used. Given that, the majority of the diff is NFC-ish, but the key difference is that canConvertValue returns false when only one side is a non-integral pointer.

Thanks to Cherry Zhang for the test case.

Differential Revision: https://reviews.llvm.org/D59000




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355962 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed