Skip to content

Commit 3d82a1b

Browse files
qartikaborgna-q
authored andcommitted
chore(hugr-llvm): upgrade to inkwell 0.6.0 (#2128)
Part of quantinuum-dev/hugrverse#158
1 parent 2b8686b commit 3d82a1b

File tree

7 files changed

+23
-10
lines changed

7 files changed

+23
-10
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DEVELOPMENT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ shell by setting up [direnv](https://devenv.sh/automatic-shell-activation/).
2828

2929
To setup the environment manually you will need:
3030

31-
- Just: https://just.systems/
32-
- Rust `>=1.85`: https://www.rust-lang.org/tools/install
33-
- uv `>=0.3`: docs.astral.sh/uv/getting-started/installation
34-
- Optional: capnproto `>=1.0`: https://capnproto.org/install.html
31+
- Just: <https://just.systems/>
32+
- Rust `>=1.85`: <https://www.rust-lang.org/tools/install>
33+
- uv `>=0.3`: <https://docs.astral.sh/uv/getting-started/installation>
34+
- Optional: capnproto `>=1.0`: <https://capnproto.org/install.html>
3535
Required when modifying the `hugr-model` serialization schema.
3636
- Optional: llvm `== 14.0`. The "llvm" feature (backed by the sub-crate `hugr-llvm`)
3737
requires LLVM installed. We use the rust bindings

hugr-llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ llvm14-0 = ["inkwell/llvm14-0"]
2323

2424

2525
[dependencies]
26-
inkwell = { version = "0.5.0", default-features = false }
26+
inkwell = { version = "0.6.0", default-features = false }
2727
hugr-core = { path = "../hugr-core", version = "0.15.4" }
2828
anyhow = "1.0.98"
2929
itertools.workspace = true

hugr-llvm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ version will only change on major releases.
2525

2626
## Developing hugr-llvm
2727

28-
See [DEVELOPMENT](DEVELOPMENT.md) for instructions on setting up the development environment.
28+
See [DEVELOPMENT](../DEVELOPMENT.md) for instructions on setting up the development environment.
2929

3030
## License
3131

hugr-llvm/src/extension/collections/static_array.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fn value_is_const<'c>(value: impl BasicValue<'c>) -> bool {
5858
BasicValueEnum::PointerValue(v) => v.is_const(),
5959
BasicValueEnum::StructValue(v) => v.is_const(),
6060
BasicValueEnum::VectorValue(v) => v.is_const(),
61+
BasicValueEnum::ScalableVectorValue(v) => v.is_const(),
6162
}
6263
}
6364

@@ -109,6 +110,13 @@ fn const_array<'c>(
109110
.collect_vec()
110111
.as_slice(),
111112
),
113+
BasicTypeEnum::ScalableVectorType(t) => t.const_array(
114+
values
115+
.into_iter()
116+
.map(|x| x.as_basic_value_enum().into_scalable_vector_value())
117+
.collect_vec()
118+
.as_slice(),
119+
),
112120
}
113121
}
114122

hugr-llvm/src/sum.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fn basic_type_undef<'c>(t: impl BasicType<'c>) -> BasicValueEnum<'c> {
4747
BasicTypeEnum::PointerType(t) => t.get_undef().as_basic_value_enum(),
4848
BasicTypeEnum::StructType(t) => t.get_undef().as_basic_value_enum(),
4949
BasicTypeEnum::VectorType(t) => t.get_undef().as_basic_value_enum(),
50+
BasicTypeEnum::ScalableVectorType(t) => t.get_undef().as_basic_value_enum(),
5051
}
5152
}
5253

@@ -60,6 +61,7 @@ fn basic_type_poison<'c>(t: impl BasicType<'c>) -> BasicValueEnum<'c> {
6061
BasicTypeEnum::PointerType(t) => t.get_poison().as_basic_value_enum(),
6162
BasicTypeEnum::StructType(t) => t.get_poison().as_basic_value_enum(),
6263
BasicTypeEnum::VectorType(t) => t.get_poison().as_basic_value_enum(),
64+
BasicTypeEnum::ScalableVectorType(t) => t.get_poison().as_basic_value_enum(),
6365
}
6466
}
6567

hugr-llvm/src/sum/layout.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ fn size_of_type<'c>(t: impl BasicType<'c>) -> Option<u64> {
4545
BasicTypeEnum::PointerType(t) => t.size_of().get_zero_extended_constant(),
4646
BasicTypeEnum::StructType(t) => t.size_of().and_then(|x| x.get_zero_extended_constant()),
4747
BasicTypeEnum::VectorType(t) => t.size_of().and_then(|x| x.get_zero_extended_constant()),
48+
BasicTypeEnum::ScalableVectorType(t) => {
49+
t.size_of().and_then(|x| x.get_zero_extended_constant())
50+
}
4851
}
4952
}
5053

0 commit comments

Comments
 (0)