[CodeExtractor] Preserve entire scope of labels when moving them
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Mon, 12 Dec 2022 16:23:37 +0000 (11:23 -0500)
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Mon, 12 Dec 2022 20:48:55 +0000 (15:48 -0500)
commitb432dd2d4b75847cc51bd3d4b41f4d71ca9bf0bd
tree809d9dd52856e64db18b0baaefa8d53a9bc9a712
parent79d59c3f3e8abb66a758793bfd9acd8ea6b3d92b
[CodeExtractor] Preserve entire scope of labels when moving them

When a dbg.label is moved into a new function, its corresponding scope
should be preserved, with the exception of the subprogram at the end of
the scope chain, which should now be the subprogram of the destination
function. See D139671.

Differential Revision: https://reviews.llvm.org/D139849
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/test/Transforms/HotColdSplit/split-out-dbg-label.ll