MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / check_post_egraph

Method check_post_egraph

cranelift/codegen/src/egraph/mod.rs:1071–1091  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1069
1070 #[cfg(debug_assertions)]
1071 fn check_post_egraph(&self) {
1072 // Verify that no union nodes are reachable from inst args,
1073 // and that all inst args' defining instructions are in the
1074 // layout.
1075 for block in self.func.layout.blocks() {
1076 for inst in self.func.layout.block_insts(block) {
1077 self.func
1078 .dfg
1079 .inst_values(inst)
1080 .for_each(|arg| match self.func.dfg.value_def(arg) {
1081 ValueDef::Result(i, _) => {
1082 debug_assert!(self.func.layout.inst_block(i).is_some());
1083 }
1084 ValueDef::Union(..) => {
1085 panic!("egraph union node {arg} still reachable at {inst}!");
1086 }
1087 _ => {}
1088 })
1089 }
1090 }
1091 }
1092
1093 #[cfg(not(debug_assertions))]
1094 fn check_post_egraph(&self) {}

Callers 1

elaborateMethod · 0.80

Calls 4

blocksMethod · 0.80
block_instsMethod · 0.80
inst_valuesMethod · 0.80
value_defMethod · 0.80

Tested by

no test coverage detected