-dump-ir is a command line option specified in lib/Optimizer/IROptimizer.cpp. It should be available on the command line for any binary that links against the Optimizer lib. For example, you can specify it when running the image-classifier. There are examples of running the image-classifier at tests/images/run.sh, so you could append it to any of those. It also should work when running unit tests that link against Optimizer, e.g. ./tests/OperatorTest -dump-ir.