nir: Add a function for rewriting the condition of an if statement

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2 files changed