[Mlir-commits] [clang] [llvm] [mlir] [IRBuilder] Remove custom insertion point type (PR #228117)

Nikita Popov llvmlistbot at llvm.org
Thu Oct 1 09:52:09 PDT 2026


================
@@ -6812,7 +6811,7 @@ void CodeGenFunction::EmitOMPOrderedBlockAssocDirective(
         assert(S.getBeginLoc().isValid() &&
                "Outlined function call location must be valid.");
         ApplyDebugLocation::CreateDefaultArtificial(*this, S.getBeginLoc());
-        OMPBuilderCBHelpers::EmitCaptureStmt(*this, CodeGenIP, *FiniBB,
+        OMPBuilderCBHelpers::EmitCaptureStmt(*this, CodeGenBB->end(), *FiniBB,
----------------
nikic wrote:

splitBBWithSuffix() moves the instruction that CodeGenIP points to to a different block, but EmitCaptureStmt() is supposed to operate on the original block. It previously worked because the block and the iterator in CodeGenIP could go out of sync.

I've changed EmitCaptureStmt to only accept a BasicBlock instead of iterator, because that's the only thing it actually used. The use of `end()` here was basically arbitrary.

https://github.com/llvm/llvm-project/pull/228117


More information about the Mlir-commits mailing list