[clang] [CIR] Support __builtin_nondeterministic_value (PR #206149)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 26 23:50:26 PDT 2026
================
@@ -1636,8 +1636,13 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
builder.createIsFPClass(loc, v, cir::FPClassTest(test)),
convertType(e->getType())));
}
- case Builtin::BI__builtin_nondeterministic_value:
- return errorBuiltinNYI(*this, e, builtinID);
+ case Builtin::BI__builtin_nondeterministic_value: {
+ mlir::Type ty = convertType(e->getArg(0)->getType());
+ mlir::Value result =
+ cir::ConstantOp::create(builder, loc, ty, cir::PoisonAttr::get(ty));
+ result = builder.createFreeze(loc, result);
----------------
xlauko wrote:
```suggestion
result = cir::FreezeOp::create(builder, loc, value);
```
https://github.com/llvm/llvm-project/pull/206149
More information about the cfe-commits
mailing list