[PATCH] D30226: [BranchFolding] Merge debug locations from common tail instead of removing

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 08:24:51 PST 2017


andreadb added a comment.

> However, if identical insturctions that are merged into a common tail have the same debug locations, there's no need to remove them.

Out of curiosity, did you see this happening in real code?

In general, I am not against the idea of using `getMergedLocation` . However, as far as I understand, in practice you can only end up in a situation where common code has the same debug location as a result of macro expansion, and if we didn't run pass AddDiscriminators.
When building for PGO, we would end up running pass AddDiscriminators, and instructions from different basic blocks would end up having different discriminators.


https://reviews.llvm.org/D30226





More information about the llvm-commits mailing list