mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename transfer -> send.
Accomplished using clangd's rename functionality.
This commit is contained in:
@@ -40,8 +40,8 @@ using PartitionTester = Partition::PartitionTester;
|
||||
struct MockedPartitionOpEvaluator final
|
||||
: PartitionOpEvaluatorBaseImpl<MockedPartitionOpEvaluator> {
|
||||
MockedPartitionOpEvaluator(Partition &workingPartition,
|
||||
TransferringOperandSetFactory &ptrSetFactory,
|
||||
TransferringOperandToStateMap &operandToStateMap)
|
||||
SendingOperandSetFactory &ptrSetFactory,
|
||||
SendingOperandToStateMap &operandToStateMap)
|
||||
: PartitionOpEvaluatorBaseImpl(workingPartition, ptrSetFactory,
|
||||
operandToStateMap) {}
|
||||
|
||||
@@ -83,8 +83,8 @@ struct MockedPartitionOpEvaluatorWithFailureCallback final
|
||||
FailureCallbackTy failureCallback;
|
||||
|
||||
MockedPartitionOpEvaluatorWithFailureCallback(
|
||||
Partition &workingPartition, TransferringOperandSetFactory &ptrSetFactory,
|
||||
TransferringOperandToStateMap &operandToStateMap,
|
||||
Partition &workingPartition, SendingOperandSetFactory &ptrSetFactory,
|
||||
SendingOperandToStateMap &operandToStateMap,
|
||||
FailureCallbackTy failureCallback)
|
||||
: PartitionOpEvaluatorBaseImpl(workingPartition, ptrSetFactory,
|
||||
operandToStateMap),
|
||||
@@ -133,10 +133,10 @@ struct MockedPartitionOpEvaluatorWithFailureCallback final
|
||||
// Tests
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// When we transfer we need a specific transfer instruction. We do not ever
|
||||
// When we send we need a specific send instruction. We do not ever
|
||||
// actually dereference the instruction, so just use some invalid ptr values so
|
||||
// we can compare.
|
||||
Operand *transferSingletons[5] = {
|
||||
Operand *operandSingletons[5] = {
|
||||
(Operand *)0xDEAD0000, (Operand *)0xFEAD0000, (Operand *)0xAEDF0000,
|
||||
(Operand *)0xFEDA0000, (Operand *)0xFBDA0000,
|
||||
};
|
||||
@@ -154,16 +154,16 @@ SILLocation fakeLoc = SILLocation::invalid();
|
||||
// yields p3.
|
||||
TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap sendingOpToStateMap(historyFactory);
|
||||
|
||||
Partition p1(historyFactory.get());
|
||||
Partition p2(historyFactory.get());
|
||||
Partition p3(historyFactory.get());
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p1, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p1, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(0)),
|
||||
PartitionOp::AssignFresh(Element(1)),
|
||||
PartitionOp::AssignFresh(Element(2)),
|
||||
@@ -171,7 +171,7 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p2, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p2, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(5)),
|
||||
PartitionOp::AssignFresh(Element(6)),
|
||||
PartitionOp::AssignFresh(Element(7)),
|
||||
@@ -179,7 +179,7 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p3, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p3, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(2)),
|
||||
PartitionOp::AssignFresh(Element(3)),
|
||||
PartitionOp::AssignFresh(Element(4)),
|
||||
@@ -191,7 +191,7 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
EXPECT_FALSE(Partition::equals(p1, p3));
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p1, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p1, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(4)),
|
||||
PartitionOp::AssignFresh(Element(5)),
|
||||
PartitionOp::AssignFresh(Element(6)),
|
||||
@@ -200,7 +200,7 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p2, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p2, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(1)),
|
||||
PartitionOp::AssignFresh(Element(2)),
|
||||
PartitionOp::AssignFresh(Element(3)),
|
||||
@@ -209,7 +209,7 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p3, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p3, factory, sendingOpToStateMap);
|
||||
eval.apply({PartitionOp::AssignFresh(Element(6)),
|
||||
PartitionOp::AssignFresh(Element(7)),
|
||||
PartitionOp::AssignFresh(Element(0)),
|
||||
@@ -228,12 +228,12 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
|
||||
auto apply_to_p1_and_p3 = [&](PartitionOp op) {
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p1, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p1, factory, sendingOpToStateMap);
|
||||
eval.apply(op);
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p3, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p3, factory, sendingOpToStateMap);
|
||||
eval.apply(op);
|
||||
}
|
||||
expect_join_eq();
|
||||
@@ -241,12 +241,12 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
|
||||
auto apply_to_p2_and_p3 = [&](PartitionOp op) {
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p2, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p2, factory, sendingOpToStateMap);
|
||||
eval.apply(op);
|
||||
}
|
||||
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p3, factory, transferringOpToStateMap);
|
||||
MockedPartitionOpEvaluator eval(p3, factory, sendingOpToStateMap);
|
||||
eval.apply(op);
|
||||
}
|
||||
expect_join_eq();
|
||||
@@ -272,9 +272,9 @@ TEST(PartitionUtilsTest, TestMergeAndJoin) {
|
||||
|
||||
TEST(PartitionUtilsTest, Join1) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Element data1[] = {Element(0), Element(1), Element(2),
|
||||
Element(3), Element(4), Element(5)};
|
||||
@@ -315,9 +315,9 @@ TEST(PartitionUtilsTest, Join1) {
|
||||
|
||||
TEST(PartitionUtilsTest, Join2) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Element data1[] = {Element(0), Element(1), Element(2),
|
||||
Element(3), Element(4), Element(5)};
|
||||
@@ -364,9 +364,9 @@ TEST(PartitionUtilsTest, Join2) {
|
||||
|
||||
TEST(PartitionUtilsTest, Join2Reversed) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Element data1[] = {Element(0), Element(1), Element(2),
|
||||
Element(3), Element(4), Element(5)};
|
||||
@@ -413,9 +413,9 @@ TEST(PartitionUtilsTest, Join2Reversed) {
|
||||
|
||||
TEST(PartitionUtilsTest, JoinLarge) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Element data1[] = {
|
||||
Element(0), Element(1), Element(2), Element(3), Element(4),
|
||||
@@ -554,9 +554,9 @@ TEST(PartitionUtilsTest, JoinLarge) {
|
||||
// This test tests the semantics of assignment.
|
||||
TEST(PartitionUtilsTest, TestAssign) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p1(historyFactory.get());
|
||||
Partition p2(historyFactory.get());
|
||||
@@ -645,9 +645,9 @@ TEST(PartitionUtilsTest, TestAssign) {
|
||||
// This test tests that consumption consumes entire regions as expected
|
||||
TEST(PartitionUtilsTest, TestConsumeAndRequire) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p(historyFactory.get());
|
||||
|
||||
@@ -678,9 +678,9 @@ TEST(PartitionUtilsTest, TestConsumeAndRequire) {
|
||||
// expected: p: ((0 1 2) (3 4 5) (6 7) (8 9) (Element(10))
|
||||
// (Element(11)))
|
||||
|
||||
PartitionOp::Transfer(Element(2), transferSingletons[0]),
|
||||
PartitionOp::Transfer(Element(7), transferSingletons[1]),
|
||||
PartitionOp::Transfer(Element(10), transferSingletons[2])});
|
||||
PartitionOp::Send(Element(2), operandSingletons[0]),
|
||||
PartitionOp::Send(Element(7), operandSingletons[1]),
|
||||
PartitionOp::Send(Element(10), operandSingletons[2])});
|
||||
}
|
||||
|
||||
// expected: p: ({0 1 2 6 7 10} (3 4 5) (8 9) (Element(11)))
|
||||
@@ -744,9 +744,9 @@ TEST(PartitionUtilsTest, TestConsumeAndRequire) {
|
||||
// copies of partitions
|
||||
TEST(PartitionUtilsTest, TestCopyConstructor) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p1(historyFactory.get());
|
||||
{
|
||||
@@ -760,7 +760,7 @@ TEST(PartitionUtilsTest, TestCopyConstructor) {
|
||||
// Change p1 again.
|
||||
{
|
||||
MockedPartitionOpEvaluator eval(p1, factory, transferringOpToStateMap);
|
||||
eval.apply(PartitionOp::Transfer(Element(0), transferSingletons[0]));
|
||||
eval.apply(PartitionOp::Send(Element(0), operandSingletons[0]));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -782,9 +782,9 @@ TEST(PartitionUtilsTest, TestCopyConstructor) {
|
||||
|
||||
TEST(PartitionUtilsTest, TestUndoTransfer) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p(historyFactory.get());
|
||||
MockedPartitionOpEvaluatorWithFailureCallback eval(
|
||||
@@ -793,16 +793,16 @@ TEST(PartitionUtilsTest, TestUndoTransfer) {
|
||||
|
||||
// Shouldn't error on this.
|
||||
eval.apply({PartitionOp::AssignFresh(Element(0)),
|
||||
PartitionOp::Transfer(Element(0), transferSingletons[0]),
|
||||
PartitionOp::UndoTransfer(Element(0), instSingletons[0]),
|
||||
PartitionOp::Send(Element(0), operandSingletons[0]),
|
||||
PartitionOp::UndoSend(Element(0), instSingletons[0]),
|
||||
PartitionOp::Require(Element(0), instSingletons[0])});
|
||||
}
|
||||
|
||||
TEST(PartitionUtilsTest, TestLastEltInTransferredRegion) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
// First make sure that we do this correctly with an assign fresh.
|
||||
Partition p(historyFactory.get());
|
||||
@@ -811,10 +811,10 @@ TEST(PartitionUtilsTest, TestLastEltInTransferredRegion) {
|
||||
eval.apply({PartitionOp::AssignFresh(Element(0)),
|
||||
PartitionOp::AssignFresh(Element(1)),
|
||||
PartitionOp::AssignFresh(Element(2)),
|
||||
PartitionOp::Transfer(Element(0), transferSingletons[0]),
|
||||
PartitionOp::Send(Element(0), operandSingletons[0]),
|
||||
PartitionOp::AssignFresh(Element(0))});
|
||||
}
|
||||
p.validateRegionToTransferredOpMapRegions();
|
||||
p.validateRegionToSendingOpMapRegions();
|
||||
|
||||
// Now make sure that we do this correctly with assign.
|
||||
Partition p2(historyFactory.get());
|
||||
@@ -823,18 +823,18 @@ TEST(PartitionUtilsTest, TestLastEltInTransferredRegion) {
|
||||
eval.apply({PartitionOp::AssignFresh(Element(0)),
|
||||
PartitionOp::AssignFresh(Element(1)),
|
||||
PartitionOp::AssignFresh(Element(2)),
|
||||
PartitionOp::Transfer(Element(0), transferSingletons[0]),
|
||||
PartitionOp::Send(Element(0), operandSingletons[0]),
|
||||
PartitionOp::Assign(Element(0), Element(2))});
|
||||
}
|
||||
p2.validateRegionToTransferredOpMapRegions();
|
||||
p2.validateRegionToSendingOpMapRegions();
|
||||
}
|
||||
|
||||
TEST(PartitionUtilsTest, TestHistory_CreateVariable) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
// First make sure that we do this correctly with an assign fresh.
|
||||
Partition p(historyFactory.get());
|
||||
@@ -859,9 +859,9 @@ TEST(PartitionUtilsTest, TestHistory_CreateVariable) {
|
||||
|
||||
TEST(PartitionUtilsTest, TestHistory_AssignRegion) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
|
||||
// First make sure that we do this correctly with an assign fresh.
|
||||
@@ -899,9 +899,9 @@ TEST(PartitionUtilsTest, TestHistory_AssignRegion) {
|
||||
|
||||
TEST(PartitionUtilsTest, TestHistory_BuildNewRegionRepIsMergee) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
|
||||
Partition p(historyFactory.get());
|
||||
@@ -947,10 +947,10 @@ TEST(PartitionUtilsTest, TestHistory_BuildNewRegionRepIsMergee) {
|
||||
|
||||
TEST(PartitionUtilsTest, TestHistory_ReturnFalseWhenNoneLeft) {
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p(historyFactory.get());
|
||||
|
||||
@@ -973,7 +973,7 @@ TEST(PartitionUtilsTest, TestHistory_ReturnFalseWhenNoneLeft) {
|
||||
TEST(PartitionUtilsTest, TestHistory_JoiningTwoEmpty) {
|
||||
// Make sure that we do sane things when we join empty history.
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
|
||||
@@ -988,10 +988,10 @@ TEST(PartitionUtilsTest, TestHistory_JoiningTwoEmpty) {
|
||||
TEST(PartitionUtilsTest, TestHistory_JoiningNotEmptyAndEmpty) {
|
||||
// Make sure that we do sane things when we join empty history.
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
|
||||
Partition p1(historyFactory.get());
|
||||
Partition p2(historyFactory.get());
|
||||
@@ -1013,9 +1013,9 @@ TEST(PartitionUtilsTest, TestHistory_JoiningNotEmptyAndEmpty) {
|
||||
TEST(PartitionUtilsTest, TestHistory_JoiningEmptyAndNotEmpty) {
|
||||
// Make sure that we do sane things when we join empty history.
|
||||
llvm::BumpPtrAllocator allocator;
|
||||
Partition::TransferringOperandSetFactory factory(allocator);
|
||||
Partition::SendingOperandSetFactory factory(allocator);
|
||||
IsolationHistory::Factory historyFactory(allocator);
|
||||
TransferringOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SendingOperandToStateMap transferringOpToStateMap(historyFactory);
|
||||
SmallVector<IsolationHistory, 8> joinedHistories;
|
||||
|
||||
Partition p1(historyFactory.get());
|
||||
|
||||
Reference in New Issue
Block a user