Only do annotations in debug builds
This commit is contained in:
@@ -1133,6 +1133,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
OperandPos::Before,
|
||||
);
|
||||
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
ProgPoint::after(inst),
|
||||
@@ -1145,6 +1147,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// N.B.: in order to integrate with the move
|
||||
// resolution that joins LRs in general, we
|
||||
@@ -1711,6 +1714,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
for entry in &list {
|
||||
self.ranges[entry.index.index()].bundle = to;
|
||||
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
entry.range.from,
|
||||
@@ -1724,6 +1729,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.bundles[to.index()].ranges = list;
|
||||
|
||||
return true;
|
||||
@@ -1763,6 +1769,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
}
|
||||
last_range = Some(entry.range);
|
||||
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if self.ranges[entry.index.index()].bundle == from {
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
@@ -1777,6 +1785,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log::debug!(
|
||||
" -> merged result for bundle{}: range{}",
|
||||
@@ -2698,6 +2707,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
cur_uses.next();
|
||||
}
|
||||
|
||||
#[cfg(debug)]
|
||||
{
|
||||
self.annotate(
|
||||
existing_range.to,
|
||||
format!(
|
||||
@@ -2709,6 +2720,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
new_bundle.index(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
cur_range = new_range;
|
||||
cur_bundle = new_bundle;
|
||||
@@ -3285,6 +3297,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
);
|
||||
debug_assert!(alloc != Allocation::none());
|
||||
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
range.from,
|
||||
@@ -3307,6 +3321,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Does this range follow immediately after a prior
|
||||
// range in the same block? If so, insert a move (if
|
||||
@@ -3419,6 +3434,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
),
|
||||
alloc,
|
||||
});
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
self.cfginfo.block_exit[block.index()],
|
||||
@@ -3433,6 +3450,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
blockparam_out_idx += 1;
|
||||
}
|
||||
|
||||
@@ -3482,6 +3500,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
from_block.index(),
|
||||
alloc,
|
||||
);
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
self.cfginfo.block_entry[block.index()],
|
||||
@@ -3495,6 +3515,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
blockparam_in_idx += 1;
|
||||
}
|
||||
|
||||
@@ -3829,12 +3850,18 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
input_alloc
|
||||
);
|
||||
if input_alloc != output_alloc {
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
self.annotate(
|
||||
ProgPoint::before(inst),
|
||||
format!(" reuse-input-copy: {} -> {}", input_alloc, output_alloc),
|
||||
format!(
|
||||
" reuse-input-copy: {} -> {}",
|
||||
input_alloc, output_alloc
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
self.insert_move(
|
||||
ProgPoint::before(inst),
|
||||
InsertMovePrio::ReusedInput,
|
||||
@@ -3999,6 +4026,8 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
self.stats.edits_count = self.edits.len();
|
||||
|
||||
// Add debug annotations.
|
||||
#[cfg(debug)]
|
||||
{
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
for i in 0..self.edits.len() {
|
||||
let &(pos, _, ref edit) = &self.edits[i];
|
||||
@@ -4020,6 +4049,7 @@ impl<'a, F: Function> Env<'a, F> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn add_edit(&mut self, pos: ProgPoint, prio: InsertMovePrio, edit: Edit) {
|
||||
match &edit {
|
||||
|
||||
Reference in New Issue
Block a user