Skip to content

spv: minimal OpSpecConstantOp and OpConstantFunctionPointerINTEL support. #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions examples/spv-lower-link-qptr-lift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ fn main() -> std::io::Result<()> {
after_pass("", &module)?;

// HACK(eddyb) this is roughly what Rust-GPU would need.
let layout_config = &spirt::qptr::LayoutConfig {
let layout_config = &spirt::mem::LayoutConfig {
abstract_bool_size_align: (1, 1),
logical_ptr_size_align: (4, 4),
..spirt::qptr::LayoutConfig::VULKAN_SCALAR_LAYOUT
..spirt::mem::LayoutConfig::VULKAN_SCALAR_LAYOUT
};

eprint_duration(|| {
Expand All @@ -92,9 +92,11 @@ fn main() -> std::io::Result<()> {
eprintln!("qptr::lower_from_spv_ptrs");
after_pass("qptr::lower_from_spv_ptrs", &module)?;

eprint_duration(|| spirt::passes::qptr::analyze_uses(&mut module, layout_config));
eprintln!("qptr::analyze_uses");
after_pass("qptr::analyze_uses", &module)?;
eprint_duration(|| {
spirt::passes::qptr::analyze_mem_accesses(&mut module, layout_config)
});
eprintln!("mem::analyze_accesses");
after_pass("mem::analyze_accesses", &module)?;

eprint_duration(|| spirt::passes::qptr::lift_to_spv_ptrs(&mut module, layout_config));
eprintln!("qptr::lift_to_spv_ptrs");
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions src/cf/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! Control-flow abstractions and passes.
//
// FIXME(eddyb) consider moving more definitions into this module.

use crate::spv;

// NOTE(eddyb) all the modules are declared here, but they're documented "inside"
// (i.e. using inner doc comments).
pub mod cfgssa;
pub mod structurize;
pub mod unstructured;

#[derive(Clone)]
pub enum SelectionKind {
/// Two-case selection based on boolean condition, i.e. `if`-`else`, with
/// the two cases being "then" and "else" (in that order).
BoolCond,

SpvInst(spv::Inst),
}

#[derive(Clone)]
pub enum ExitInvocationKind {
SpvInst(spv::Inst),
}
Loading
Loading