Assumption cache pointers become stale after function splitting and dependencies from old function can't be removed as such.
This patch:
- un-registers the assumption cache before basic blocks are outlined
- verifies the AssumptionCache of the original function to make sure no stale entries remain
- Fixed a bug in assumption cache where the AssumeHandle wasn't removing an assume instrinsic while unregistering an Assumption
See D67936 for the quickfix to this bug.
Is the findAffectedValues() operation inside of AssumptionCache not finding values because the llvm.assume is moved to another function? I.e. the search stops at an Argument? I think adding a unit test to CodeExtractorTest.cpp would really help.