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