Move verify calls out of Context.
Also, move flowgraph() calls out of filetest and into the passes that need them so that filetest doesn't have embedded knowledge of these dependencies. This resolves a TODO about the way Context was running the verifier, and it makes the Context functions and the filetest runners more transparent. This also fixes simple_gvn to use the existing dominator tree rather than computing its own.
This commit is contained in:
@@ -13,10 +13,11 @@ fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool {
|
||||
|
||||
/// Perform simple GVN on `func`.
|
||||
///
|
||||
pub fn do_simple_gvn(func: &mut Function, cfg: &mut ControlFlowGraph) {
|
||||
let mut visible_values: HashMap<(InstructionData, Type), Inst> = HashMap::new();
|
||||
pub fn do_simple_gvn(func: &mut Function, cfg: &mut ControlFlowGraph, domtree: &mut DominatorTree) {
|
||||
cfg.ensure(func);
|
||||
domtree.ensure(func, cfg);
|
||||
|
||||
let domtree = DominatorTree::with_function(func, cfg);
|
||||
let mut visible_values: HashMap<(InstructionData, Type), Inst> = HashMap::new();
|
||||
|
||||
// Visit EBBs in a reverse post-order.
|
||||
let mut pos = Cursor::new(&mut func.layout);
|
||||
|
||||
Reference in New Issue
Block a user