Pack all stall detection parts into a compiler macro