Change MachineVerifier to call AnalysisUsage::addUsedIfAvailable for
analyses like LiveIntervals that it can verify.
Before this change, if pass P1 is the last user of analysis A1, the
legacy pass manager will free A1 after running P1 and *before* running
the machine verifier, so the analysis will not be verified even if P1
claimed to preserve it.
After this change, the machine verifier will be seen as a user of A1, so
it will not be freed until after the verifier has run and verified it.
The effect of this is that analyses are verified in more places than
they were before, which shows up some problems:
- AMDGPU's SIOptimizeExecMaskingPreRA claimed to preserve all analyses but apparently does not preserve LiveIntervals
- HexagonExpandCondsets claimed to preserve LiveIntervals but apparently does not
- PPCTLSDynamicCall claimed to preserve LiveIntervals but apparently does not
- Many (mostly X86) tests still fail because TwoAddressInstruction does not preserve LiveVariables
There are also some codegen differences, presumably because optional
analyses are no longer available in some places where they were
available before.
Probably should file an issue for this