DeletionCallbackHandle is used to remove stale GlobalAA information whenever a Function or GlobalValue is deleted. In GlobalsAAResult::AnalyzeCallGraph, we failed to do that for functions inserted into DenseMap FunctionInfos, so after those functions are deleted, there are stale entries inside of FunctionInfos. More seriously, FunctionInfos contains pairs from function pointer to ModRefInfo. If the deleted function space is reallocated to a new function, we will get wrong mod ref information for the new function from GlobalAA. The patch fixed it by creating DeletionCallbackHandle when a function is inserted into FunctionInfos.
The issue is exposed as a runtime failure in a big application, only when compiler is built in release mode, and when thinlto and new pass manager is used to build the application. So I havn't got a way to get a small testcase.