Two backend optimizations failed to handle cases when compiled with -g, due to failing to consider DBG_VALUE instructions. This was in SystemZTargetLowering::emitSelect() and SystemZElimCompare::getRegReferences().
This patch makes sure that DBG_VALUEs are recognized so that they do not affect these optimizers.
Tests for branch-on-count, load-and-trap and consecutive selects.