[SimplifyCFG] Drop debug loc in SpeculativelyExecuteBB
authorVedant Kumar <vsk@apple.com>
Tue, 23 Jun 2020 22:53:09 +0000 (15:53 -0700)
committerVedant Kumar <vsk@apple.com>
Wed, 24 Jun 2020 01:25:52 +0000 (18:25 -0700)
commitf8bd6a75edac7560deb5fdcb31041b454dd9d7e0
tree4f3ca04ac81d99d4221ce14d9ca849e8d8d7da90
parenta162048a47b7e1c7e83fca82f09876944307dd2f
[SimplifyCFG] Drop debug loc in SpeculativelyExecuteBB

Summary:
According to HowToUpdateDebugInfo.rst:

```
Preserving the debug locations of speculated instructions can make
it seem like a condition is true when it's not (or vice versa), which
leads to a confusing single-stepping experience
```

This patch follows the recommendation to drop debug locations on
speculated instructions.

Reviewers: aprantl, davide

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82420
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/drop-debug-loc-when-speculating.ll [new file with mode: 0644]