@@ -76,9 +76,8 @@ TEST_F(MemorySSATest, CreateALoad) {
76
76
// We create a diamond where there is a store on one side, and then after
77
77
// building MemorySSA, create a load after the merge point, and use it to test
78
78
// updating by creating an access for the load.
79
- F = Function::Create (
80
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
81
- GlobalValue::ExternalLinkage, " F" , &M);
79
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
80
+ GlobalValue::ExternalLinkage, " F" , &M);
82
81
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
83
82
BasicBlock *Left (BasicBlock::Create (C, " " , F));
84
83
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -114,9 +113,8 @@ TEST_F(MemorySSATest, CreateLoadsAndStoreUpdater) {
114
113
// incrementally update it by inserting a store in the, entry, a load in the
115
114
// merge point, then a store in the branch, another load in the merge point,
116
115
// and then a store in the entry.
117
- F = Function::Create (
118
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
119
- GlobalValue::ExternalLinkage, " F" , &M);
116
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
117
+ GlobalValue::ExternalLinkage, " F" , &M);
120
118
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
121
119
BasicBlock *Left (BasicBlock::Create (C, " " , F));
122
120
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -204,9 +202,8 @@ TEST_F(MemorySSATest, CreateALoadUpdater) {
204
202
// We create a diamond, then build memoryssa with no memory accesses, and
205
203
// incrementally update it by inserting a store in one of the branches, and a
206
204
// load in the merge point
207
- F = Function::Create (
208
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
209
- GlobalValue::ExternalLinkage, " F" , &M);
205
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
206
+ GlobalValue::ExternalLinkage, " F" , &M);
210
207
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
211
208
BasicBlock *Left (BasicBlock::Create (C, " " , F));
212
209
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -248,9 +245,8 @@ TEST_F(MemorySSATest, CreateALoadUpdater) {
248
245
}
249
246
250
247
TEST_F (MemorySSATest, SinkLoad) {
251
- F = Function::Create (
252
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
253
- GlobalValue::ExternalLinkage, " F" , &M);
248
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
249
+ GlobalValue::ExternalLinkage, " F" , &M);
254
250
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
255
251
BasicBlock *Left (BasicBlock::Create (C, " " , F));
256
252
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -298,9 +294,8 @@ TEST_F(MemorySSATest, MoveAStore) {
298
294
// a load at the end. After building MemorySSA, we test updating by moving
299
295
// the store from the side block to the entry block. This destroys the old
300
296
// access.
301
- F = Function::Create (
302
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
303
- GlobalValue::ExternalLinkage, " F" , &M);
297
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
298
+ GlobalValue::ExternalLinkage, " F" , &M);
304
299
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
305
300
BasicBlock *Left (BasicBlock::Create (C, " " , F));
306
301
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -334,9 +329,8 @@ TEST_F(MemorySSATest, MoveAStoreUpdater) {
334
329
// a load at the end. After building MemorySSA, we test updating by moving
335
330
// the store from the side block to the entry block. This destroys the old
336
331
// access.
337
- F = Function::Create (
338
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
339
- GlobalValue::ExternalLinkage, " F" , &M);
332
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
333
+ GlobalValue::ExternalLinkage, " F" , &M);
340
334
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
341
335
BasicBlock *Left (BasicBlock::Create (C, " " , F));
342
336
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -380,9 +374,8 @@ TEST_F(MemorySSATest, MoveAStoreUpdaterMove) {
380
374
// a load at the end. After building MemorySSA, we test updating by moving
381
375
// the store from the side block to the entry block. This does not destroy
382
376
// the old access.
383
- F = Function::Create (
384
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
385
- GlobalValue::ExternalLinkage, " F" , &M);
377
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
378
+ GlobalValue::ExternalLinkage, " F" , &M);
386
379
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
387
380
BasicBlock *Left (BasicBlock::Create (C, " " , F));
388
381
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -424,9 +417,8 @@ TEST_F(MemorySSATest, MoveAStoreAllAround) {
424
417
// a load at the end. After building MemorySSA, we test updating by moving
425
418
// the store from the side block to the entry block, then to the other side
426
419
// block, then to before the load. This does not destroy the old access.
427
- F = Function::Create (
428
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
429
- GlobalValue::ExternalLinkage, " F" , &M);
420
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
421
+ GlobalValue::ExternalLinkage, " F" , &M);
430
422
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
431
423
BasicBlock *Left (BasicBlock::Create (C, " " , F));
432
424
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -479,9 +471,8 @@ TEST_F(MemorySSATest, RemoveAPhi) {
479
471
// We create a diamond where there is a store on one side, and then a load
480
472
// after the merge point. This enables us to test a bunch of different
481
473
// removal cases.
482
- F = Function::Create (
483
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
484
- GlobalValue::ExternalLinkage, " F" , &M);
474
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
475
+ GlobalValue::ExternalLinkage, " F" , &M);
485
476
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
486
477
BasicBlock *Left (BasicBlock::Create (C, " " , F));
487
478
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -524,9 +515,8 @@ TEST_F(MemorySSATest, RemoveMemoryAccess) {
524
515
// We create a diamond where there is a store on one side, and then a load
525
516
// after the merge point. This enables us to test a bunch of different
526
517
// removal cases.
527
- F = Function::Create (
528
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
529
- GlobalValue::ExternalLinkage, " F" , &M);
518
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
519
+ GlobalValue::ExternalLinkage, " F" , &M);
530
520
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
531
521
BasicBlock *Left (BasicBlock::Create (C, " " , F));
532
522
BasicBlock *Right (BasicBlock::Create (C, " " , F));
@@ -885,9 +875,8 @@ TEST_F(MemorySSATest, Irreducible) {
885
875
886
876
SmallVector<PHINode *, 8 > Inserted;
887
877
IRBuilder<> B (C);
888
- F = Function::Create (
889
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
890
- GlobalValue::ExternalLinkage, " F" , &M);
878
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
879
+ GlobalValue::ExternalLinkage, " F" , &M);
891
880
892
881
// Make blocks
893
882
BasicBlock *IfBB = BasicBlock::Create (C, " if" , F);
@@ -924,9 +913,8 @@ TEST_F(MemorySSATest, MoveToBeforeLiveOnEntryInvalidatesCache) {
924
913
// ...And be sure that MSSA's caching doesn't give us `1` for the clobber of
925
914
// `2` after `1` is removed.
926
915
IRBuilder<> B (C);
927
- F = Function::Create (
928
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
929
- GlobalValue::ExternalLinkage, " F" , &M);
916
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
917
+ GlobalValue::ExternalLinkage, " F" , &M);
930
918
931
919
BasicBlock *Entry = BasicBlock::Create (C, " if" , F);
932
920
B.SetInsertPoint (Entry);
@@ -969,9 +957,8 @@ TEST_F(MemorySSATest, RemovingDefInvalidatesCache) {
969
957
// And be sure that MSSA's caching handles the removal of def `1`
970
958
// appropriately.
971
959
IRBuilder<> B (C);
972
- F = Function::Create (
973
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
974
- GlobalValue::ExternalLinkage, " F" , &M);
960
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
961
+ GlobalValue::ExternalLinkage, " F" , &M);
975
962
976
963
BasicBlock *Entry = BasicBlock::Create (C, " if" , F);
977
964
B.SetInsertPoint (Entry);
@@ -1045,10 +1032,9 @@ TEST_F(MemorySSATest, TestStoreMustAlias) {
1045
1032
1046
1033
// Test May alias for optimized defs.
1047
1034
TEST_F (MemorySSATest, TestStoreMayAlias) {
1048
- F = Function::Create (FunctionType::get (B.getVoidTy (),
1049
- {B.getInt8PtrTy (), B.getInt8PtrTy ()},
1050
- false ),
1051
- GlobalValue::ExternalLinkage, " F" , &M);
1035
+ F = Function::Create (
1036
+ FunctionType::get (B.getVoidTy (), {B.getPtrTy (), B.getPtrTy ()}, false ),
1037
+ GlobalValue::ExternalLinkage, " F" , &M);
1052
1038
B.SetInsertPoint (BasicBlock::Create (C, " " , F));
1053
1039
Type *Int8 = Type::getInt8Ty (C);
1054
1040
auto *ArgIt = F->arg_begin ();
@@ -1117,9 +1103,8 @@ TEST_F(MemorySSATest, LifetimeMarkersAreClobbers) {
1117
1103
// it.
1118
1104
1119
1105
IRBuilder<> B (C);
1120
- F = Function::Create (
1121
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1122
- GlobalValue::ExternalLinkage, " F" , &M);
1106
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1107
+ GlobalValue::ExternalLinkage, " F" , &M);
1123
1108
1124
1109
// Make blocks
1125
1110
BasicBlock *Entry = BasicBlock::Create (C, " entry" , F);
@@ -1244,10 +1229,9 @@ TEST_F(MemorySSATest, DefOptimizationsAreInvalidatedOnMoving) {
1244
1229
}
1245
1230
1246
1231
TEST_F (MemorySSATest, TestOptimizedDefsAreProperUses) {
1247
- F = Function::Create (FunctionType::get (B.getVoidTy (),
1248
- {B.getInt8PtrTy (), B.getInt8PtrTy ()},
1249
- false ),
1250
- GlobalValue::ExternalLinkage, " F" , &M);
1232
+ F = Function::Create (
1233
+ FunctionType::get (B.getVoidTy (), {B.getPtrTy (), B.getPtrTy ()}, false ),
1234
+ GlobalValue::ExternalLinkage, " F" , &M);
1251
1235
B.SetInsertPoint (BasicBlock::Create (C, " " , F));
1252
1236
Type *Int8 = Type::getInt8Ty (C);
1253
1237
Value *AllocA = B.CreateAlloca (Int8, ConstantInt::get (Int8, 1 ), " A" );
@@ -1322,9 +1306,8 @@ TEST_F(MemorySSATest, TestOptimizedDefsAreProperUses) {
1322
1306
// ; 4 = MemoryDef(3); optimized to 3, cannot optimize thorugh phi.
1323
1307
// Insert edge: entry -> exit, check mssa Update is correct.
1324
1308
TEST_F (MemorySSATest, TestAddedEdgeToBlockWithPhiNotOpt) {
1325
- F = Function::Create (
1326
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1327
- GlobalValue::ExternalLinkage, " F" , &M);
1309
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1310
+ GlobalValue::ExternalLinkage, " F" , &M);
1328
1311
Argument *PointerArg = &*F->arg_begin ();
1329
1312
BasicBlock *Entry (BasicBlock::Create (C, " entry" , F));
1330
1313
BasicBlock *Header (BasicBlock::Create (C, " header" , F));
@@ -1378,9 +1361,8 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiNotOpt) {
1378
1361
// the optimized access.
1379
1362
// Insert edge: entry -> exit, check mssa Update is correct.
1380
1363
TEST_F (MemorySSATest, TestAddedEdgeToBlockWithPhiOpt) {
1381
- F = Function::Create (
1382
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1383
- GlobalValue::ExternalLinkage, " F" , &M);
1364
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1365
+ GlobalValue::ExternalLinkage, " F" , &M);
1384
1366
Argument *PointerArg = &*F->arg_begin ();
1385
1367
Type *Int8 = Type::getInt8Ty (C);
1386
1368
BasicBlock *Entry (BasicBlock::Create (C, " entry" , F));
@@ -1450,9 +1432,8 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiOpt) {
1450
1432
// e:
1451
1433
// ; 2 = MemoryPhi({d, 4}, {f, 1})
1452
1434
TEST_F (MemorySSATest, TestAddedEdgeToBlockWithNoPhiAddNewPhis) {
1453
- F = Function::Create (
1454
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1455
- GlobalValue::ExternalLinkage, " F" , &M);
1435
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1436
+ GlobalValue::ExternalLinkage, " F" , &M);
1456
1437
Argument *PointerArg = &*F->arg_begin ();
1457
1438
BasicBlock *Entry (BasicBlock::Create (C, " entry" , F));
1458
1439
BasicBlock *ABlock (BasicBlock::Create (C, " a" , F));
@@ -1499,9 +1480,8 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithNoPhiAddNewPhis) {
1499
1480
}
1500
1481
1501
1482
TEST_F (MemorySSATest, TestCallClobber) {
1502
- F = Function::Create (
1503
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1504
- GlobalValue::ExternalLinkage, " F" , &M);
1483
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1484
+ GlobalValue::ExternalLinkage, " F" , &M);
1505
1485
1506
1486
Value *Pointer1 = &*F->arg_begin ();
1507
1487
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
@@ -1532,9 +1512,8 @@ TEST_F(MemorySSATest, TestCallClobber) {
1532
1512
}
1533
1513
1534
1514
TEST_F (MemorySSATest, TestLoadClobber) {
1535
- F = Function::Create (
1536
- FunctionType::get (B.getVoidTy (), {B.getInt8PtrTy ()}, false ),
1537
- GlobalValue::ExternalLinkage, " F" , &M);
1515
+ F = Function::Create (FunctionType::get (B.getVoidTy (), {B.getPtrTy ()}, false ),
1516
+ GlobalValue::ExternalLinkage, " F" , &M);
1538
1517
1539
1518
Value *Pointer1 = &*F->arg_begin ();
1540
1519
BasicBlock *Entry (BasicBlock::Create (C, " " , F));
0 commit comments