Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q authored and ss2165 committed Dec 11, 2024
1 parent 9185231 commit c179e0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
11 changes: 4 additions & 7 deletions hugr-llvm/src/emit/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use hugr_core::{
types::{SumType, Type, TypeEnum},
HugrView, NodeIndex,
};
use inkwell::types::{BasicTypeEnum, IntType};
use inkwell::values::{BasicValueEnum, CallableValue, IntValue};
use inkwell::types::BasicTypeEnum;
use inkwell::values::{BasicValueEnum, CallableValue};
use itertools::{zip_eq, Itertools};
use petgraph::visit::Walker;

Expand All @@ -21,7 +21,7 @@ use crate::{

use super::{
deaggregate_call_result,
func::{EmitFuncContext, RowMailBox, RowPromise},
func::{EmitFuncContext, RowPromise},
EmitOpArgs,
};

Expand All @@ -31,7 +31,6 @@ struct DataflowParentEmitter<'c, 'hugr, OT, H> {
node: FatNode<'hugr, OT, H>,
inputs: Option<Vec<BasicValueEnum<'c>>>,
outputs: Option<RowPromise<'c>>,
output_vals: Option<Vec<BasicValueEnum<'c>>>,
}

impl<'c, 'hugr, OT: OpTrait, H: HugrView> DataflowParentEmitter<'c, 'hugr, OT, H>
Expand All @@ -43,7 +42,6 @@ where
node: args.node,
inputs: Some(args.inputs),
outputs: Some(args.outputs),
output_vals: None,
}
}

Expand Down Expand Up @@ -310,13 +308,12 @@ fn emit_cfg<'c, H: HugrView>(

fn emit_tail_loop<'c, H: HugrView>(
context: &mut EmitFuncContext<'c, '_, H>,
args: EmitOpArgs<'c, '_, TailLoop, H>
args: EmitOpArgs<'c, '_, TailLoop, H>,
) -> Result<()> {
// TODO: Switch on the tag in loop_body to see where to go next
// TODO: Handle "other" args
let node = args.node();


// Make a block to jump to when we `Break`
let out_bb = context.new_basic_block("loop_out", None);
// A block for the body of the loop
Expand Down
13 changes: 6 additions & 7 deletions hugr-llvm/src/emit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use anyhow::{anyhow, Result};
use hugr_core::builder::{
BuildHandle, Container, DFGWrapper, HugrBuilder, ModuleBuilder, SubContainer,
};
use hugr_core::extension::prelude::{bool_t, usize_t, PRELUDE, PRELUDE_ID};
use hugr_core::extension::prelude::PRELUDE_ID;
use hugr_core::extension::{ExtensionRegistry, ExtensionSet};
use hugr_core::ops::handle::FuncID;
use hugr_core::std_extensions::arithmetic::{
conversions, float_ops, float_types, int_ops, int_types,
};
use hugr_core::std_extensions::{collections, logic};
use hugr_core::types::{SumType, TypeRow};
use hugr_core::types::TypeRow;
use hugr_core::{Hugr, HugrView};
use inkwell::module::Module;
use inkwell::passes::PassManager;
Expand Down Expand Up @@ -246,7 +246,7 @@ mod test_fns {
use super::*;
use crate::custom::CodegenExtsBuilder;
use crate::extension::int::add_int_extensions;
use crate::types::HugrFuncType;
use crate::types::{HugrFuncType, HugrSumType};

use hugr_core::builder::DataflowSubContainer;
use hugr_core::builder::{Container, Dataflow, HugrBuilder, ModuleBuilder, SubContainer};
Expand Down Expand Up @@ -555,7 +555,6 @@ mod test_fns {
let hugr = {
let just_input = usize_t();
let just_output = Type::UNIT;
let sum_ty = SumType::new(vec![just_input.clone(), just_output.clone()]);
let input_v = TypeRow::from(vec![just_input.clone()]);
let output_v = TypeRow::from(vec![just_output.clone()]);

Expand Down Expand Up @@ -602,7 +601,7 @@ mod test_fns {
let just_input = int_ty.clone();
let just_output = Type::UNIT;
let other_ty = int_ty.clone();
let sum_ty = SumType::new(vec![just_input.clone(), just_output.clone()]);
let sum_ty = HugrSumType::new(vec![just_input.clone(), just_output.clone()]);
let input_v = TypeRow::from(vec![just_input.clone(), other_ty.clone()]);
let output_v = TypeRow::from(vec![just_output.clone(), other_ty.clone()]);

Expand All @@ -625,11 +624,11 @@ mod test_fns {
vec![just_output.clone()].into(),
)
.unwrap();
let [sum_inp_w, other_w] = tail_b.input_wires_arr();
let [sum_inp_w, _other_w] = tail_b.input_wires_arr();

let zero = ConstInt::new_u(6, 0).unwrap();
let zero_w = tail_b.add_load_value(zero);
let [result] = tail_b
let [_result] = tail_b
.add_dataflow_op(
int_ops::IntOpDef::ile_u.with_log_width(6),
[sum_inp_w, zero_w],
Expand Down

0 comments on commit c179e0a

Please sign in to comment.