Skip to content

Commit 75a375b

Browse files
authored
Merge branch 'main' into bughunt-loop-shortcut-0.4.0
2 parents 1324889 + e8757ad commit 75a375b

29 files changed

Lines changed: 2280 additions & 1552 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ jobs:
1818
submodules: true
1919
- uses: actions-rs/toolchain@v1
2020
with:
21-
# FIXME(eddyb) `style_edition = "2024"` in `rustfmt.toml` is what keeps
22-
# this on `nightly`, should switch to `stable` when that stabilizes.
23-
toolchain: nightly
24-
# HACK(eddyb) use `nightly` by default without breaking the ability to
21+
toolchain: stable
22+
# HACK(eddyb) use `stable` by default without breaking the ability to
2523
# temporarily bypass it through `rust-toolchain.toml`.
2624
default: true
2725
override: false
@@ -63,7 +61,7 @@ jobs:
6361
override: true
6462
# NOTE(eddyb) this is the simplest way found so far to get `glslang`.
6563
- name: Prepare Vulkan SDK
66-
uses: humbletim/setup-vulkan-sdk@v1.2.0
64+
uses: humbletim/setup-vulkan-sdk@v1.2.1
6765
with:
6866
vulkan-query-version: 1.3.250.0
6967
vulkan-components: Glslang SPIRV-Tools

.github/workflows/rustdoc-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
id: pages
4141
uses: actions/configure-pages@v2
4242
- name: Upload artifact
43-
uses: actions/upload-pages-artifact@v1
43+
uses: actions/upload-pages-artifact@v3
4444
with:
4545
# Upload entire doc folder
4646
path: './target/doc'
@@ -66,4 +66,4 @@ jobs:
6666
steps:
6767
- name: Deploy to GitHub Pages
6868
id: deployment
69-
uses: actions/deploy-pages@v1
69+
uses: actions/deploy-pages@v4

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "spirt"
33
description = "Shader-focused IR to target, transform and translate from."
4-
repository = "https://github.com/rust-gpu/spirt/tree/0.4.0"
4+
repository = "https://github.com/rust-gpu/spirt"
55
homepage = "https://github.com/rust-gpu/spirt"
66
version = "0.4.0"
77
authors = ["SPIR-T developers", "Embark <opensource@embark-studios.com>"]
8-
edition = "2021"
8+
edition = "2024"
99
license = "MIT OR Apache-2.0"
1010
readme = "README.md"
1111
# FIXME(eddyb) should this point to the version built from `git`?

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ With the initial focus being on [Rust-GPU]'s usecase, various (otherwise desirab
6363
* "entity" system for e.g. definitions in a module, instructions in a function, etc.
6464
* disallows iteration in favor of/forcing the use of efficient indexing
6565
* structured control-flow "regions" inspired by RVSDG, stricter than SPIR-V
66-
(see `ControlRegionDef`'s docs for more details)
66+
(see `RegionDef`'s docs for more details)
6767

6868
</td><td>
6969

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() {
77
std::env::current_dir().unwrap().join("khronos-spec/SPIRV-Headers/include/spirv/unified1");
88
println!("cargo:rerun-if-changed={}", khr_spv_include_dir.display());
99

10-
if !std::fs::metadata(&khr_spv_include_dir).map_or(false, |m| m.is_dir()) {
10+
if !std::fs::metadata(&khr_spv_include_dir).is_ok_and(|m| m.is_dir()) {
1111
eprintln!(" error: {} is not a directory", khr_spv_include_dir.display());
1212
eprintln!(" help: git submodules are required to build from a git checkout");
1313
eprintln!(" help: run `git submodule update --init`");

src/cfg.rs

Lines changed: 185 additions & 182 deletions
Large diffs are not rendered by default.

src/cfgssa.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! be taken to preserve the correctness of such implicit dataflow across all
1414
//! transformations, and it's overall far more fragile than the local dataflow
1515
//! of e.g. phi nodes (or their alternative "block arguments"), or in SPIR-T's
16-
//! case, `ControlRegion` inputs and `ControlNode` outputs (inspired by RVSDG,
16+
//! case, `Region` inputs and `Node` outputs (inspired by RVSDG,
1717
//! which has even stricter isolation/locality in its regions).
1818
1919
use crate::{FxIndexMap, FxIndexSet};
@@ -228,10 +228,13 @@ impl<'a, BlockId: Copy + Eq + Hash, DefId: Copy + Eq + Hash, DefType: Copy>
228228
.map(|block_id| BlockIdx(self.def_map.blocks_by_id.get_index_of(&block_id).unwrap()));
229229

230230
if self.blocks[target_block_idx].preds.insert(source_block_idx) {
231-
self.add_uses_to(source_block_idx, AddUsesSource::PropagateBackwardsAcrossEdge {
232-
target: target_block_idx,
233-
only_dirty: false,
234-
});
231+
self.add_uses_to(
232+
source_block_idx,
233+
AddUsesSource::PropagateBackwardsAcrossEdge {
234+
target: target_block_idx,
235+
only_dirty: false,
236+
},
237+
);
235238
}
236239
}
237240

@@ -240,10 +243,13 @@ impl<'a, BlockId: Copy + Eq + Hash, DefId: Copy + Eq + Hash, DefType: Copy>
240243
for i in 0..self.blocks[block_idx].preds.len() {
241244
let pred_block_idx = self.blocks[block_idx].preds[i];
242245

243-
self.add_uses_to(pred_block_idx, AddUsesSource::PropagateBackwardsAcrossEdge {
244-
target: block_idx,
245-
only_dirty: true,
246-
});
246+
self.add_uses_to(
247+
pred_block_idx,
248+
AddUsesSource::PropagateBackwardsAcrossEdge {
249+
target: block_idx,
250+
only_dirty: true,
251+
},
252+
);
247253
}
248254
self.blocks[block_idx].dirty_chunks.clear();
249255
}
@@ -452,6 +458,8 @@ mod data {
452458

453459
// HACK(eddyb) most of the need for this arises from avoidance of
454460
// `unsafe` code (i.e. `MaybeUninit<V>` could suffice in most cases).
461+
// FIXME(eddyb) figure out if keeping this around is useful at all.
462+
#[allow(unused)]
455463
pub enum WrapNonDefaultValueInOption {}
456464
impl<V> ValueStorage<V> for WrapNonDefaultValueInOption {
457465
type Slot = Option<V>;
@@ -556,7 +564,7 @@ mod data {
556564
self.contains(k).then(|| self.entry(k).remove().unwrap())
557565
}
558566

559-
pub fn keys(&self) -> impl Iterator<Item = K> {
567+
pub fn keys(&self) -> impl Iterator<Item = K> + use<K, V, VS> {
560568
let mut i = 0;
561569
let mut remaining = self.occupied;
562570
iter::from_fn(move || {

src/context.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@ interners! {
888888
crate::AttrSetDef,
889889
crate::TypeDef,
890890
crate::ConstDef,
891-
crate::DataInstFormDef,
892891
}
893892

894893
// FIXME(eddyb) consider a more uniform naming scheme than the combination
@@ -897,7 +896,6 @@ interners! {
897896
AttrSet default(crate::AttrSetDef::default()) => crate::AttrSetDef,
898897
Type => crate::TypeDef,
899898
Const => crate::ConstDef,
900-
DataInstForm => crate::DataInstFormDef,
901899
}
902900

903901
impl<I: sealed::Interned> InternInCx<I> for I::Def
@@ -962,7 +960,7 @@ macro_rules! entities {
962960
entities! {
963961
GlobalVar => chunk_size(0x1_0000) crate::GlobalVarDecl,
964962
Func => chunk_size(0x1_0000) crate::FuncDecl,
965-
ControlRegion => chunk_size(0x1000) crate::ControlRegionDef,
966-
ControlNode => chunk_size(0x1000) EntityListNode<ControlNode, crate::ControlNodeDef>,
963+
Region => chunk_size(0x1000) crate::RegionDef,
964+
Node => chunk_size(0x1000) EntityListNode<Node, crate::NodeDef>,
967965
DataInst => chunk_size(0x1000) EntityListNode<DataInst, crate::DataInstDef>,
968966
}

0 commit comments

Comments
 (0)