Bug: https://bugs.llvm.org/show_bug.cgi?id=41175
In the bug test case the DSE pass is shortening the range of memory that a memset is working on. A getelementptr is generated so that the new starting address can be passed to memset. This instruction was not given a DebugLoc.
To fix the bug I copy the DebugLoc from the memset instruction.
I've added a test that checks this.
is the !16 necessary? Hardcoded numbers are bound to break sooner or later.