From af8ac8f8caa6a1b7b6fa070bd14d899e0f93d848 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 20 Mar 2018 17:37:09 -0700 Subject: [PATCH] Avoid calling `analyze_branch()` when the `BranchInfo` is not needed. It's faster to just call `opcode().is_branch()`. --- lib/cretonne/src/regalloc/live_value_tracker.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/cretonne/src/regalloc/live_value_tracker.rs index bedd0480e5..5cb3a6f694 100644 --- a/lib/cretonne/src/regalloc/live_value_tracker.rs +++ b/lib/cretonne/src/regalloc/live_value_tracker.rs @@ -6,7 +6,6 @@ use dominator_tree::DominatorTree; use entity::{EntityList, ListPool}; -use ir::instructions::BranchInfo; use ir::{Inst, Ebb, Value, DataFlowGraph, Layout, ExpandedProgramPoint}; use partition_slice::partition_slice; use regalloc::affinity::Affinity; @@ -261,9 +260,8 @@ impl LiveValueTracker { ) -> (&[LiveValue], &[LiveValue], &[LiveValue]) { // Save a copy of the live values before any branches or jumps that could be somebody's // immediate dominator. - match dfg.analyze_branch(inst) { - BranchInfo::NotABranch => {} - _ => self.save_idom_live_set(inst), + if dfg[inst].opcode().is_branch() { + self.save_idom_live_set(inst); } // Move killed values to the end of the vector.