@@ -48,10 +48,9 @@ namespace llvm::AMDGPU {
4848} // namespace llvm::AMDGPU
4949
5050static cl::opt<bool > DisableDiffBasePtrMemClustering (
51- " amdgpu-disable-diff-baseptr-mem-clustering" ,
52- cl::desc (" Disable clustering memory ops with different base pointers" ),
53- cl::init(false ),
54- cl::Hidden);
51+ " amdgpu-disable-diff-baseptr-mem-clustering" ,
52+ cl::desc (" Disable clustering memory ops with different base pointers" ),
53+ cl::init(false ), cl::Hidden);
5554
5655// Must be at least 4 to be able to branch over minimum unconditional branch
5756// code. This is only for making it possible to write reasonably small tests for
@@ -529,9 +528,9 @@ bool SIInstrInfo::getMemOperandsWithOffsetWidth(
529528}
530529
531530static bool memOpsHaveSameAddrspace (const MachineInstr &MI1,
532- ArrayRef<const MachineOperand *> BaseOps1,
533- const MachineInstr &MI2,
534- ArrayRef<const MachineOperand *> BaseOps2) {
531+ ArrayRef<const MachineOperand *> BaseOps1,
532+ const MachineInstr &MI2,
533+ ArrayRef<const MachineOperand *> BaseOps2) {
535534 // If base is identical, assume identical addrspace
536535 if (BaseOps1.front ()->isIdenticalTo (*BaseOps2.front ()))
537536 return true ;
@@ -585,14 +584,14 @@ bool SIInstrInfo::shouldClusterMemOps(ArrayRef<const MachineOperand *> BaseOps1,
585584 if (!BaseOps1.empty () && !BaseOps2.empty ()) {
586585 const MachineInstr &FirstLdSt = *BaseOps1.front ()->getParent ();
587586 const MachineInstr &SecondLdSt = *BaseOps2.front ()->getParent ();
588-
587+
589588 if (!DisableDiffBasePtrMemClustering) {
590589 // Only consider memory ops from same addrspace for clustering
591590 if (!memOpsHaveSameAddrspace (FirstLdSt, BaseOps1, SecondLdSt, BaseOps2))
592591 return false ;
593592 } else {
594- // If the mem ops (to be clustered) do not have the same base ptr, then they
595- // should not be clustered
593+ // If the mem ops (to be clustered) do not have the same base ptr, then
594+ // they should not be clustered
596595 if (!memOpsHaveSameBasePtr (FirstLdSt, BaseOps1, SecondLdSt, BaseOps2))
597596 return false ;
598597 }
0 commit comments