[semantic-arc-opts] Implement @owned phi web elimination for phi webs with a single phi node that only have copy_value introducers.

This is the most simple initial version that I can commit. The hope is that this will help to bring this up in a nice way.

I am going to handle the multiple phi node and load [copy] case later to reduce
code churn.

<rdar://problem/56720436>
This commit is contained in:
Michael Gottesman
2020-03-05 19:44:12 -08:00
parent 57f54dd1a3
commit 6fee59bd6a
5 changed files with 956 additions and 50 deletions

View File

@@ -90,6 +90,37 @@ TEST(FrozenMultiMapCustomTest, SimpleFind) {
}
}
TEST(FrozenMultiMapCustomTest, TestResetWorks) {
Canary::resetIDs();
FrozenMultiMap<Canary, Canary> map;
auto key1 = Canary();
auto key2 = Canary();
map.insert(key1, Canary());
map.insert(key1, Canary());
map.insert(key1, Canary());
map.insert(key2, Canary());
map.insert(key2, Canary());
map.setFrozen();
map.reset();
map.insert(key1, Canary());
map.insert(key1, Canary());
map.insert(key1, Canary());
map.insert(key2, Canary());
map.insert(key2, Canary());
map.setFrozen();
// Just do a quick sanity test.
auto range = map.getRange();
auto begin = range.begin();
auto end = range.end();
++begin;
++begin;
EXPECT_EQ(std::distance(begin, end), 0);
}
TEST(FrozenMultiMapCustomTest, SimpleIter) {
Canary::resetIDs();
FrozenMultiMap<Canary, Canary> map;