Revert "[OpenMP][IRBuilder] Perform finalization (incl. outlining) late"

This reverts commit 8a56d64d76.

Will be recommitted once the clang test problem is addressed.
This commit is contained in:
Johannes Doerfert
2020-02-12 18:50:22 -06:00
parent d1b393d92c
commit 3aac953afa
5 changed files with 110 additions and 171 deletions

View File

@@ -1405,7 +1405,11 @@ static void fixupDebugInfoPostExtraction(Function &OldFunc, Function &NewFunc,
DISubprogram *OldSP = OldFunc.getSubprogram();
LLVMContext &Ctx = OldFunc.getContext();
if (!OldSP) {
// See llvm.org/PR44560, OpenMP passes an invalid subprogram to CodeExtractor.
bool NeedWorkaroundForOpenMPIRBuilderBug =
OldSP && OldSP->getRetainedNodes()->isTemporary();
if (!OldSP || NeedWorkaroundForOpenMPIRBuilderBug) {
// Erase any debug info the new function contains.
stripDebugInfo(NewFunc);
// Make sure the old function doesn't contain any non-local metadata refs.