@@ -502,8 +502,10 @@ class InstPartitionContainer {
502
502
SmallVector<int , 8 > PtrToPartitions (N);
503
503
for (unsigned I = 0 ; I < N; ++I) {
504
504
Value *Ptr = RtPtrCheck->Pointers [I].PointerValue ;
505
- auto Instructions =
506
- LAI.getInstructionsForAccess (Ptr, RtPtrCheck->Pointers [I].IsWritePtr );
505
+ auto Instructions = LAI.getInstructionsForAccess (Ptr, /* IsWrite */ true );
506
+ auto ReadInstructions =
507
+ LAI.getInstructionsForAccess (Ptr, /* IsWrite */ false );
508
+ Instructions.append (ReadInstructions.begin (), ReadInstructions.end ());
507
509
508
510
int &Partition = PtrToPartitions[I];
509
511
// First set it to uninitialized.
@@ -521,21 +523,6 @@ class InstPartitionContainer {
521
523
Partition = -1 ;
522
524
}
523
525
assert (Partition != -2 && " Pointer not belonging to any partition" );
524
- // All the store context uses of our address were processed,
525
- // Now make sure we don't have cross partition loads.
526
- if (RtPtrCheck->Pointers [I].IsWritePtr ) {
527
- if (Ptr->hasOneUse () || Partition == -1 )
528
- continue ;
529
-
530
- for (User *U : Ptr->users ())
531
- if (auto *CurLoad = dyn_cast<LoadInst>(U))
532
- if (L->contains (CurLoad->getParent ()))
533
- if (Partition != (int )this ->InstToPartitionId [CurLoad]) {
534
- // -1 means belonging to multiple partitions.
535
- Partition = -1 ;
536
- break ;
537
- }
538
- }
539
526
}
540
527
541
528
return PtrToPartitions;
0 commit comments