This is an archive of the discontinued LLVM Phabricator instance.

[GlobalAA] Create DeletionCallbackHandle whenever a function is inserted into FunctionInfos
AbandonedPublic

Authored by wmi on Mar 16 2018, 4:56 PM.

Details

Reviewers
chandlerc
sanjoy
Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi created this revision.Mar 16 2018, 4:56 PM
wmi abandoned this revision.Mar 16 2018, 4:57 PM

Just saw Chandler already fixed it. Thanks!

Doh! Sorry these crossed. But yes, this is exactly the patch I landed and I credited you with it already! =D