[IR] Fix ordering of passes in prepareFor*