Skip to content

Commit

Permalink
restore eval's skip-terminator behavior; bibc decoder adds expected R…
Browse files Browse the repository at this point in the history
…eturnOp
  • Loading branch information
mars-risc0 committed Oct 28, 2024
1 parent 4a22c97 commit d5c8dee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions zirgen/Dialect/BigInt/Bytecode/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ mlir::func::FuncOp decode(mlir::ModuleOp module, const Program& prog) {
}
}

// Add terminator op, for the sake of propriety.
builder.create<mlir::func::ReturnOp>(loc);
return out;
}

Expand Down
2 changes: 1 addition & 1 deletion zirgen/Dialect/BigInt/IR/Eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ EvalOutput eval(func::FuncOp inFunc, ArrayRef<APInt> witnessValues) {

llvm::DenseMap<Value, BytePoly> polys;

for (Operation& origOp : inFunc.getBody().front()) {
for (Operation& origOp : inFunc.getBody().front().without_terminator()) {
llvm::TypeSwitch<Operation*>(&origOp)
.Case<DefOp>([&](auto op) {
APInt val = witnessValues[op.getLabel()];
Expand Down

0 comments on commit d5c8dee

Please sign in to comment.