Fix: < fails when compared against empty list
Don't replace a constant with itself
Remove useless debug output
Assert that we don't try to replace specialized functions
Make output of IR files optional