[Mlir-commits] [flang] [mlir] [Flang][OpenMP] Don't generate code for unreachable target regions. (PR #178937)

Pranav Bhandarkar llvmlistbot at llvm.org
Fri Jan 30 21:11:07 PST 2026


================
@@ -6370,6 +6370,11 @@ static LogicalResult
 convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
                  LLVM::ModuleTranslation &moduleTranslation) {
   auto targetOp = cast<omp::TargetOp>(opInst);
+
+  // Skip target operations marked as unreachable
+  if (targetOp->hasAttr("omp.target_unreachable"))
----------------
bhandarkar-pranav wrote:

This literal is used in a couple of places. Instead of using a string literal, consider adding a `constexpr llvm::StringLiteral`. For example
`constexpr llvm::StringLiteral kTargetUnreachableAttr = "omp.target_unreachable"` in an appropriate  header file, perhaps `mlir/include/mlir/Dialect/OpenMP/OpenMPDialect.h`

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


More information about the Mlir-commits mailing list