[clang] [mlir] [CIR] Implement lowering for 'no-builtins' attributes (PR #178899)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 30 09:39:56 PST 2026


================
@@ -447,6 +447,20 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
                                            "modular-format",
                                            modFormat.getValue()));
 
+    if (ArrayAttr noBuiltins = callOp.getNobuiltinsAttr()) {
+      if (noBuiltins.empty())
+        call->addFnAttr(llvm::Attribute::get(moduleTranslation.getLLVMContext(),
+                                             "no-builtins"));
+
+      for (Attribute a : noBuiltins) {
+        if (auto str = dyn_cast<StringAttr>(a)) {
+          std::string attrName = ("no-builtin-" + str.getValue()).str();
+          call->addFnAttr(llvm::Attribute::get(
+              moduleTranslation.getLLVMContext(), attrName));
----------------
erichkeane wrote:

We do actually have similar attributes on the way for a bunch of otherwise annoying things (Floating point options, denormals, etc), so I suspect this will be useful for other ones I have on my plate.  Appreciate the fast review!

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


More information about the cfe-commits mailing list