[clang] [CIR][AArch64] Add lowering for `svlen` builtins (1/2) (PR #172346)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 16 16:48:04 PST 2025
Andrzej =?utf-8?q?Warzyński?= <andrzej.warzynski at gmail.com>,
Andrzej =?utf-8?q?Warzyński?= <andrzej.warzynski at gmail.com>,
Andrzej =?utf-8?q?Warzyński?= <andrzej.warzynski at gmail.com>,Andrzej
Warzynski <andrzej.warzynski at arm.com>,Andrzej Warzynski
<andrzej.warzynski at arm.com>,Andrzej Warzynski <andrzej.warzynski at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/172346 at github.com>
================
@@ -30,6 +31,27 @@ using namespace clang;
using namespace clang::CIRGen;
using namespace llvm;
+template <typename... Operands>
+static mlir::Value emitIntrinsicCallOp(CIRGenBuilderTy &builder,
+ mlir::Location loc, const StringRef str,
+ const mlir::Type &resTy,
+ Operands &&...op) {
+ return cir::LLVMIntrinsicCallOp::create(builder, loc,
+ builder.getStringAttr(str), resTy,
+ std::forward<Operands>(op)...)
+ .getResult();
+}
+
+// Generate vscale * scalingFactor
+static mlir::Value genVscaleTimesFactor(mlir::Location loc,
+ CIRGenBuilderTy builder,
+ mlir::Type cirTy,
+ int32_t scalingFactor) {
+ auto vscale = emitIntrinsicCallOp(builder, loc, "vscale", cirTy);
----------------
andykaylor wrote:
```suggestion
mlir::Value vscale = emitIntrinsicCallOp(builder, loc, "vscale", cirTy);
```
We're much less liberal with `auto` in Clang than MLIR code is.
https://github.com/llvm/llvm-project/pull/172346
More information about the cfe-commits
mailing list