LLZK
0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp
Go to the documentation of this file.
1
//===-- Ops.cpp - Felt operation implementations ----------------*- C++ -*-===//
2
//
3
// Part of the LLZK Project, under the Apache License v2.0.
4
// See LICENSE.txt for license information.
5
// Copyright 2025 Veridise Inc.
6
// SPDX-License-Identifier: Apache-2.0
7
//
8
//===----------------------------------------------------------------------===//
9
10
#include "
llzk/Dialect/Felt/IR/Ops.h
"
11
#include "
llzk/Dialect/Polymorphic/IR/Types.h
"
12
#include "
llzk/Util/TypeHelper.h
"
13
14
#include <mlir/IR/Builders.h>
15
16
#include <llvm/ADT/SmallString.h>
17
18
// TableGen'd implementation files
19
#include "
llzk/Dialect/Felt/IR/OpInterfaces.cpp.inc
"
20
21
// TableGen'd implementation files
22
#define GET_OP_CLASSES
23
#include "
llzk/Dialect/Felt/IR/Ops.cpp.inc
"
24
25
using namespace
mlir
;
26
27
namespace
llzk::felt
{
28
29
//===------------------------------------------------------------------===//
30
// FeltConstantOp
31
//===------------------------------------------------------------------===//
32
33
void
FeltConstantOp::getAsmResultNames
(OpAsmSetValueNameFn setNameFn) {
34
llvm::SmallString<32> buf;
35
llvm::raw_svector_ostream os(buf);
36
os <<
"felt_const_"
;
37
getValue
().toStringUnsigned(buf);
38
setNameFn(
getResult
(), buf);
39
}
40
41
OpFoldResult
FeltConstantOp::fold
(
FeltConstantOp::FoldAdaptor
) {
return
getValueAttr
(); }
42
43
}
// namespace llzk::felt
OpInterfaces.cpp.inc
Ops.cpp.inc
Ops.h
Types.h
TypeHelper.h
llzk::felt::FeltConstantOp::FoldAdaptor
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition
Ops.h.inc:743
llzk::felt::FeltConstantOp::getValue
::llvm::APInt getValue()
Definition
Ops.cpp.inc:716
llzk::felt::FeltConstantOp::getValueAttr
::llzk::felt::FeltConstAttr getValueAttr()
Definition
Ops.h.inc:795
llzk::felt::FeltConstantOp::getResult
::mlir::TypedValue<::llzk::felt::FeltType > getResult()
Definition
Ops.h.inc:782
llzk::felt::FeltConstantOp::getAsmResultNames
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition
Ops.cpp:33
llzk::felt::FeltConstantOp::fold
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
Definition
Ops.cpp:41
llzk::felt
Definition
Attrs.cpp:13
mlir
Definition
AnalysisPassEnums.h.inc:39
lib
Dialect
Felt
IR
Ops.cpp
Generated by
1.14.0
Copyright 2025 Veridise Inc. under the Apache License v2.0. Copyright 2026 Project LLZK under the Apache License v2.0.