If the source instruction has !nosanitize metadata, all instructions created during combining should also have it.
The !nosanitize metadata indicates that LLVM should not insert any sanitizer instrumentation.
This https://github.com/google/sanitizers/issues/1508 false positive is caused:
- InstCombine do not preserve !nosanitize for newly created instructions if source instruction has !nosanitize metadata and
- ASan instruments for pointer comparison and subtraction instruction even if it has !nosanitize metadata
This patch and D126269 together will fix the false positive.