]> granicus.if.org Git - llvm/commit
Remove debug location from common tail when tail-merging
authorRobert Lougher <rob.lougher@gmail.com>
Tue, 25 Oct 2016 18:44:07 +0000 (18:44 +0000)
committerRobert Lougher <rob.lougher@gmail.com>
Tue, 25 Oct 2016 18:44:07 +0000 (18:44 +0000)
commite05a7ffa08ea6f128050be2838b945ded860ee1d
tree54b18547b7c4576a23cb7ce873aa192fc37628a8
parent0e4bd938f46b0d43cff50f0367c7755e6787ed5f
Remove debug location from common tail when tail-merging

The branch folding pass tail merges blocks into a common-tail.  However, the
tail retains the debug information from one of the original inputs to the
merge (chosen randomly).  This is a problem for sampled-based PGO, as hits
on the common-tail will be attributed to whichever block was chosen,
irrespective of which path was actually taken to the common-tail.

This patch fixes the issue by nulling the debug location for the common-tail.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285093 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchFolding.cpp
test/DebugInfo/COFF/local-variables.ll
test/DebugInfo/X86/tail-merge.ll [new file with mode: 0644]