MergeFunctions: Clear GlobalNumbers ValueMap
authorArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 5 Oct 2015 17:26:36 +0000 (17:26 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 5 Oct 2015 17:26:36 +0000 (17:26 +0000)
commit01cf7ec623a32d1b028e7bf761b0b9e74a195e40
treef640f2e43e14f72f5e6cc4f28ae3101bef4bc3e5
parentab6273be70d34e95ebc4e131d1245dbed3584668
MergeFunctions: Clear GlobalNumbers ValueMap

Otherwise, the map will observe changes as long as MergeFunctions is alive. This
is bad because follow-up passes could replace-all-uses-with on the key of an
entry in the map. The value handle callback of ValueMap however asserts that the
key type matches.

rdar://22971893

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249327 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/MergeFunctions.cpp
test/Transforms/MergeFunc/crash2.ll [new file with mode: 0644]