Players who are on IR, as well as the players called up to replace them in the lineup both count against the salary cap. The only time that a player's salary does not count against the salary cap is if that player is placed on Long-Term Injured Reserve, which would keep them out of the lineup for a minimum of 10 games and 24 days. The Habs simply didn't have anyone who was eligible to join
Carey Price,
Sean Monahan and Paul Byron on the LTIR list and thus, could not afford to take on O'Reilly's $3.75M cap hit (50% of his $7.5M salary after the Blues' portion of the retention) before retaining the $1.875M that Minnesota ended up taking on.