When trying to use llc -run-pass stack-coloring or any other pass that
requires the StackProtector pass, the PM will fail with:
Unable to schedule 'Slot index numbering' required by 'Merge disjoint stack slots' Unable to schedule pass UNREACHABLE executed at ../lib/IR/LegacyPassManager.cpp:1314!
The problem with StackProtector is that it is an IR pass which is added
as a dependency to an MI pass.
This patch makes it so passes only use the StackProtector pass if it is
available. In general, the pass is added in TargetPassConfig::addISelPrepare.
This allows these passes to be used with -run-pass or
It also fixes one machine verifier issue by using -run-pass instead of
re-running ISel on the whole IR.