This is a recommit of D71330, but with a few things fixed/changed:
- ReachingDefAnalysis: this was not running with optnone as it was checking skipFunction(), which other analysis passes don't do. I guess this is a copy-paste from a codegen pass.
- VPTBlockPass: here I've added skipFunction(), because like most/all optimisations, we don't want to run this with optnone.
This fixes the issues with the initial/previous commit of this: the VPTBlockPass was running with optnone, but ReachingDefAnalysis wasn't, and so VPTBlockPass was crashing querying ReachingDefAnalysis.
I've added test case mve-vpt-block-optnone.mir to check that we don't run VPTBlock with optnone.
What happened to this modifies register check?
This was the original error I was looking at.