diff options
author | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-09-13 22:20:47 +0000 |
---|---|---|
committer | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-09-13 22:20:47 +0000 |
commit | 7fe9a5d9b423a156aeb95d4729be9865915801d9 (patch) | |
tree | a297f27489662d3e33c5508584326f2ffd190166 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | 3ae35eb56b11ec27bc2fcba6aeeebaf7615bd6c8 (diff) | |
download | llvm-7fe9a5d9b423a156aeb95d4729be9865915801d9.zip llvm-7fe9a5d9b423a156aeb95d4729be9865915801d9.tar.gz llvm-7fe9a5d9b423a156aeb95d4729be9865915801d9.tar.bz2 |
Allow target to decide when to cluster loads/stores in misched
MachineScheduler when clustering loads or stores checks if base
pointers point to the same memory. This check is done through
comparison of base registers of two memory instructions. This
works fine when instructions have separate offset operand. If
they require a full calculated pointer such instructions can
never be clustered according to such logic.
Changed shouldClusterMemOps to accept base registers as well and
let it decide what to do about it.
Differential Revision: https://reviews.llvm.org/D37698
llvm-svn: 313208
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 576ad118..2a9965a 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -1561,14 +1561,10 @@ void BaseMemOpClusterMutation::clusterNeighboringMemOps( std::sort(MemOpRecords.begin(), MemOpRecords.end()); unsigned ClusterLength = 1; for (unsigned Idx = 0, End = MemOpRecords.size(); Idx < (End - 1); ++Idx) { - if (MemOpRecords[Idx].BaseReg != MemOpRecords[Idx+1].BaseReg) { - ClusterLength = 1; - continue; - } - SUnit *SUa = MemOpRecords[Idx].SU; SUnit *SUb = MemOpRecords[Idx+1].SU; - if (TII->shouldClusterMemOps(*SUa->getInstr(), *SUb->getInstr(), + if (TII->shouldClusterMemOps(*SUa->getInstr(), MemOpRecords[Idx].BaseReg, + *SUb->getInstr(), MemOpRecords[Idx+1].BaseReg, ClusterLength) && DAG->addEdge(SUb, SDep(SUa, SDep::Cluster))) { DEBUG(dbgs() << "Cluster ld/st SU(" << SUa->NodeNum << ") - SU(" |