OptionalAttr<LLVM_MemoryEffectsAttr>:$memory,
DefaultValuedAttr<Visibility, "mlir::LLVM::Visibility::Default">:$visibility_,
OptionalAttr<UnitAttr>:$arm_streaming,
- OptionalAttr<UnitAttr>:$arm_locally_streaming
+ OptionalAttr<UnitAttr>:$arm_locally_streaming,
+ OptionalAttr<StrAttr>:$section
);
let regions = (region AnyRegion:$body);
if (func->hasGC())
funcOp.setGarbageCollector(StringRef(func->getGC()));
+ if (func->hasSection())
+ funcOp.setSection(StringRef(func->getSection()));
+
funcOp.setVisibility_(convertVisibilityFromLLVM(func->getVisibility()));
if (func->hasComdat())
if (auto gc = func.getGarbageCollector())
llvmFunc->setGC(gc->str());
+ if (std::optional<StringRef> section = func.getSection())
+ llvmFunc->setSection(*section);
+
if (auto armStreaming = func.getArmStreaming())
llvmFunc->addFnAttr("aarch64_pstate_sm_enabled");
else if (auto armLocallyStreaming = func.getArmLocallyStreaming())
define void @locally_streaming_func() "aarch64_pstate_sm_body" {
ret void
}
+
+// -----
+
+; CHECK-LABEL: @section_func
+; CHECK-SAME: attributes {section = ".section.name"}
+define void @section_func() section ".section.name" {
+ ret void
+}
llvm.return
}
+// -----
+
+// CHECK-LABEL: @section_func
+// CHECK-SAME: section ".section.name"
+llvm.func @section_func() attributes { section = ".section.name" } {
+ llvm.return
+}
+
+// -----
+
// CHECK-LABEL: @callFreezeOp
llvm.func @callFreezeOp(%x : i32) {
// CHECK: freeze i32 %{{[0-9]+}}