From 301294238d88b5d51eb0f9ee4c33175cfd947a9d Mon Sep 17 00:00:00 2001 From: Abid Qadeer Date: Tue, 2 Sep 2025 15:42:55 +0100 Subject: [PATCH 1/2] [OMPIRBuilder][Debug] Remove unnecessary code. In the code that fixups the debug information, we handles both the debug intrinsics and debug records. With recent changes in mlir translation, we should not get debug intrinsics anymore. This means we can simplify the code by removing the handling for debug intrinsics and only focusing on debug records. --- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp index e740c2819fec9..bd8f3835edd0d 100644 --- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp @@ -7382,9 +7382,6 @@ static void FixupDebugInfoForOutlinedFunction( // The location and scope of variable intrinsics and records still point to // the parent function of the target region. Update them. for (Instruction &I : instructions(Func)) { - if (auto *DDI = dyn_cast(&I)) - UpdateDebugRecord(DDI); - for (DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) UpdateDebugRecord(&DVR); } From d00ad571b76c55986162b378e9e92a2cfb4dc13d Mon Sep 17 00:00:00 2001 From: Abid Qadeer Date: Tue, 2 Sep 2025 18:37:38 +0100 Subject: [PATCH 2/2] Add an assert that instruction in not a debug intrinsic. --- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp index bd8f3835edd0d..03ea58318d4a9 100644 --- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp @@ -7382,6 +7382,8 @@ static void FixupDebugInfoForOutlinedFunction( // The location and scope of variable intrinsics and records still point to // the parent function of the target region. Update them. for (Instruction &I : instructions(Func)) { + assert(!isa(&I) && + "Unexpected debug intrinsic"); for (DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) UpdateDebugRecord(&DVR); }