[SimplifyCFG] Preserve metadata when unconditionalizing branches (same target).
authorMichael Kruse <llvm-project@meinersbur.de>
Mon, 26 Apr 2021 22:04:00 +0000 (17:04 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Mon, 26 Apr 2021 22:23:01 +0000 (17:23 -0500)
commitb99466eb4525b151508d8f1a054d7a7fb4731c03
tree64a480357f847e27eb222e842e94807bdcfb731d
parente01c666b136e3f97587b22a2029f31e5c36a0e71
[SimplifyCFG] Preserve metadata when unconditionalizing branches (same target).

When replacing a conditional branch by an unconditional one because the targets are identical, transfer the metadata to the new branch instruction.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D101226
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/SimplifyCFG/commondest-loopid.ll [new file with mode: 0644]