14#include "mlir/IR/Builders.h"
15#include "llvm/ADT/APInt.h"
24mlir::OpFoldResult ConstantTestOp::fold(FoldAdaptor adaptor) {
25 return getValueAttr();
32mlir::OpFoldResult GetHartIdOp::fold(FoldAdaptor adaptor) {
33 if (
auto cpuAttr = dyn_cast_or_null<CPUAttr>(adaptor.getCpu()))
34 return IntegerAttr::get(IndexType::get(getContext()), cpuAttr.getId());
42bool ImplicitConstraintTestOp::isConstraintMaterialized() {
43 return !getImplicitConstraint();
46Operation *ImplicitConstraintTestOp::materializeConstraint(OpBuilder &builder) {
48 rtg::ConstantOp::create(builder,
getLoc(), builder.getBoolAttr(
true));
49 rtg::ConstraintOp::create(builder,
getLoc(), val);
50 setImplicitConstraint(
false);
51 return getOperation();
60#include "circt/Dialect/RTGTest/IR/RTGTest.cpp.inc"
static Location getLoc(DefSlot slot)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.