diff --git a/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp b/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp index 5118d5c25d28..da0481b461e0 100644 --- a/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp +++ b/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp @@ -1026,17 +1026,17 @@ LogicalResult BuildOpGroups::buildOp(PatternRewriter &rewriter, case CmpIPredicate::eq: { StringRef opName = op.getOperationName().split(".").second; Type width = op.getResult().getType(); - auto condReg = createRegister( - op.getLoc(), rewriter, getComponent(), width.getIntOrFloatBitWidth(), - getState().getUniqueName(opName)); - - for (auto *user : op->getUsers()) { - if (auto ifOp = dyn_cast(user)) - getState().setCondReg(ifOp, condReg); - } - bool isSequential = isPipeLibOp(op.getLhs()) || isPipeLibOp(op.getRhs()); if (isSequential) { + auto condReg = createRegister( + op.getLoc(), rewriter, getComponent(), width.getIntOrFloatBitWidth(), + getState().getUniqueName(opName)); + + for (auto *user : op->getUsers()) { + if (auto ifOp = dyn_cast(user)) + getState().setCondReg(ifOp, condReg); + } + calyx::RegisterOp pipeResReg; if (isPipeLibOp(op.getLhs())) pipeResReg = getState().getPipeResReg( @@ -1647,6 +1647,7 @@ class BuildControl : public calyx::FuncOpPartialLoweringPattern { FlatSymbolRefAttr symbolAttr = nullptr; auto condReg = getState().getCondReg(ifOp); if (!condReg) { + llvm::errs() << "no condReg\n"; auto condGroup = getState() .getEvaluatingGroup(cond);