[clang] [CIR] Upstream AtomicFenceOp and signal/thread fence builtins (PR #168346)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 22 06:14:55 PST 2025
================
@@ -58,6 +58,28 @@ static RValue emitBuiltinBitOp(CIRGenFunction &cgf, const CallExpr *e,
return RValue::get(result);
}
+static mlir::Value makeAtomicFenceValue(CIRGenFunction &cgf,
+ const CallExpr *expr,
+ cir::SyncScopeKind syncScope) {
+ auto &builder = cgf.getBuilder();
+ mlir::Value orderingVal = cgf.emitScalarExpr(expr->getArg(0));
+
+ auto constOrdering = orderingVal.getDefiningOp<cir::ConstantOp>();
+ if (!constOrdering)
+ llvm_unreachable("NYI: variable ordering not supported");
----------------
Lancern wrote:
Well this is not the intended way to mark NYI features. You should instead add a missing feature guard to `MissingFeatures.h`, and change code here to:
```cpp
if (!constOrdering) {
assert(!cir::MissingFeatures::atomicVariableOrdering());
return {};
}
```
https://github.com/llvm/llvm-project/pull/168346
More information about the cfe-commits
mailing list