[clang] [CIR] Add support for the IdiomRecognizer pass (PR #208854)
Hendrik Hübner via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 11 09:15:45 PDT 2026
================
@@ -0,0 +1,53 @@
+//===-- CIRStdOps.td - CIR standard library ops ------------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// Defines ops representing standard library calls, raised from plain calls
+/// by the cir-idiom-recognizer pass and lowered back by LoweringPrepare.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_DIALECT_IR_CIRSTDOPS_TD
+#define CLANG_CIR_DIALECT_IR_CIRSTDOPS_TD
+
+// knownKind names the CIR_KnownFuncKind entry whose tagged calls raise
+// to this operation.
+class CIR_StdOp<string functionName, dag args, dag res,
+ list<Trait> traits = [], string knownKind = "">
+ : CIR_Op<"std." # functionName, traits> {
+ let arguments = !con(args, (ins FlatSymbolRefAttr:$original_fn));
+ let results = res;
+ let hasLLVMLowering = false;
+
+ let extraClassDeclaration = [{
+ static constexpr unsigned getNumArgs() {
+ return }] # !size(args) # [{;
----------------
HendrikHuebner wrote:
How will operations with overloads with a different number of arguments be handled? `std::find` has an overload with an `ExecutionPolicy` since C++17 for example.
https://github.com/llvm/llvm-project/pull/208854
More information about the cfe-commits
mailing list