summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2016-09-26 17:44:31 +0000
committerDaniel Berlin <dberlin@dberlin.org>2016-09-26 17:44:31 +0000
commitf72ac492ccea2d11c3c0dd10bcdaadec7537f9ce (patch)
tree906ec48649415428ebdd1df35a3f973d7403ab8e
parent1b9748c6a2e412cb5998b9ee7a520000b53ea967 (diff)
downloadbcm5719-llvm-f72ac492ccea2d11c3c0dd10bcdaadec7537f9ce.tar.gz
bcm5719-llvm-f72ac492ccea2d11c3c0dd10bcdaadec7537f9ce.zip
Update MemorySSA unittest to account for non-pruned SSA form
llvm-svn: 282421
-rw-r--r--llvm/unittests/Transforms/Utils/MemorySSA.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/unittests/Transforms/Utils/MemorySSA.cpp b/llvm/unittests/Transforms/Utils/MemorySSA.cpp
index e728fddae9b..b7f8545c339 100644
--- a/llvm/unittests/Transforms/Utils/MemorySSA.cpp
+++ b/llvm/unittests/Transforms/Utils/MemorySSA.cpp
@@ -65,10 +65,10 @@ public:
: M("MemorySSATest", C), B(C), DL(DLString), TLI(TLII), F(nullptr) {}
};
-TEST_F(MemorySSATest, CreateALoadAndPhi) {
+TEST_F(MemorySSATest, CreateALoad) {
// We create a diamond where there is a store on one side, and then after
// building MemorySSA, create a load after the merge point, and use it to test
- // updating by creating an access for the load and a memoryphi.
+ // updating by creating an access for the load.
F = Function::Create(
FunctionType::get(B.getVoidTy(), {B.getInt8PtrTy()}, false),
GlobalValue::ExternalLinkage, "F", &M);
@@ -80,7 +80,7 @@ TEST_F(MemorySSATest, CreateALoadAndPhi) {
B.CreateCondBr(B.getTrue(), Left, Right);
B.SetInsertPoint(Left);
Argument *PointerArg = &*F->arg_begin();
- StoreInst *StoreInst = B.CreateStore(B.getInt8(16), PointerArg);
+ B.CreateStore(B.getInt8(16), PointerArg);
BranchInst::Create(Merge, Left);
BranchInst::Create(Merge, Right);
@@ -89,14 +89,10 @@ TEST_F(MemorySSATest, CreateALoadAndPhi) {
// Add the load
B.SetInsertPoint(Merge);
LoadInst *LoadInst = B.CreateLoad(PointerArg);
- // Should be no phi to start
- EXPECT_EQ(MSSA.getMemoryAccess(Merge), nullptr);
- // Create the phi
- MemoryPhi *MP = MSSA.createMemoryPhi(Merge);
- MemoryDef *StoreAccess = cast<MemoryDef>(MSSA.getMemoryAccess(StoreInst));
- MP->addIncoming(StoreAccess, Left);
- MP->addIncoming(MSSA.getLiveOnEntryDef(), Right);
+ // MemoryPHI should already exist.
+ MemoryPhi *MP = MSSA.getMemoryAccess(Merge);
+ EXPECT_NE(MP, nullptr);
// Create the load memory acccess
MemoryUse *LoadAccess = cast<MemoryUse>(
OpenPOWER on IntegriCloud