Andrzej =?utf-8?q?Warzyński?= <[email protected]>,
Andrzej =?utf-8?q?Warzyński?= <[email protected]>,
Andrzej =?utf-8?q?Warzyński?= <[email protected]>,Andrzej
 Warzynski <[email protected]>,Andrzej Warzynski
 <[email protected]>,Andrzej Warzynski <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to