more work on custom optimization pass