CIRCT  20.0.0git
CombOps.h
Go to the documentation of this file.
1 //===- CombOps.h - Declare Comb dialect operations --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the operation classes for the Comb dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef CIRCT_DIALECT_COMB_COMBOPS_H
14 #define CIRCT_DIALECT_COMB_COMBOPS_H
15 
18 #include "circt/Support/LLVM.h"
19 #include "mlir/Bytecode/BytecodeOpInterface.h"
20 #include "mlir/IR/BuiltinOps.h"
21 #include "mlir/IR/OpImplementation.h"
22 #include "mlir/Interfaces/FunctionInterfaces.h"
23 #include "mlir/Interfaces/InferTypeOpInterface.h"
24 #include "mlir/Interfaces/SideEffectInterfaces.h"
25 
26 namespace llvm {
27 struct KnownBits;
28 }
29 
30 namespace mlir {
31 class PatternRewriter;
32 }
33 
34 #define GET_OP_CLASSES
35 #include "circt/Dialect/Comb/Comb.h.inc"
36 
37 namespace circt {
38 namespace comb {
39 
40 using llvm::KnownBits;
41 
42 /// Compute "known bits" information about the specified value - the set of bits
43 /// that are guaranteed to always be zero, and the set of bits that are
44 /// guaranteed to always be one (these must be exclusive!). A bit that exists
45 /// in neither set is unknown.
46 KnownBits computeKnownBits(Value value);
47 
48 /// Create a sign extension operation from a value of integer type to an equal
49 /// or larger integer type.
50 Value createOrFoldSExt(Location loc, Value value, Type destTy,
51  OpBuilder &builder);
52 Value createOrFoldSExt(Value value, Type destTy, ImplicitLocOpBuilder &builder);
53 
54 /// Create a ``Not'' gate on a value.
55 Value createOrFoldNot(Location loc, Value value, OpBuilder &builder,
56  bool twoState = false);
57 Value createOrFoldNot(Value value, ImplicitLocOpBuilder &builder,
58  bool twoState = false);
59 
60 } // namespace comb
61 } // namespace circt
62 
63 #endif // CIRCT_DIALECT_COMB_COMBOPS_H
Value createOrFoldNot(Location loc, Value value, OpBuilder &builder, bool twoState=false)
Create a `‘Not’' gate on a value.
Definition: CombOps.cpp:48
KnownBits computeKnownBits(Value value)
Compute "known bits" information about the specified value - the set of bits that are guaranteed to a...
Value createOrFoldSExt(Location loc, Value value, Type destTy, OpBuilder &builder)
Create a sign extension operation from a value of integer type to an equal or larger integer type.
Definition: CombOps.cpp:25
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: comb.py:1