@@ -693,10 +693,7 @@ bool MeshSharding::equalSplitAndPartialAxes(const MeshSharding &rhs) const {
693693
694694 if (getPartialAxes ().size () != rhs.getPartialAxes ().size () ||
695695 (!getPartialAxes ().empty () && getPartialType () != rhs.getPartialType ()) ||
696- !llvm::equal (
697- llvm::make_range (getPartialAxes ().begin (), getPartialAxes ().end ()),
698- llvm::make_range (rhs.getPartialAxes ().begin (),
699- rhs.getPartialAxes ().end ()))) {
696+ !llvm::equal (getPartialAxes (), rhs.getPartialAxes ())) {
700697 return false ;
701698 }
702699
@@ -708,11 +705,9 @@ bool MeshSharding::equalSplitAndPartialAxes(const MeshSharding &rhs) const {
708705 return false ;
709706 }
710707
711- return llvm::all_of (llvm::make_range (getSplitAxes ().begin () + minSize,
712- getSplitAxes ().end ()),
708+ return llvm::all_of (llvm::drop_begin (getSplitAxes (), minSize),
713709 std::mem_fn (&MeshAxesAttr::empty)) &&
714- llvm::all_of (llvm::make_range (rhs.getSplitAxes ().begin () + minSize,
715- rhs.getSplitAxes ().end ()),
710+ llvm::all_of (llvm::drop_begin (rhs.getSplitAxes (), minSize),
716711 std::mem_fn (&MeshAxesAttr::empty));
717712}
718713
@@ -723,37 +718,26 @@ bool MeshSharding::equalHaloAndShardSizes(const MeshSharding &rhs) const {
723718bool MeshSharding::equalShardSizes (const MeshSharding &rhs) const {
724719 if (rhs.getStaticShardedDimsOffsets ().size () !=
725720 getStaticShardedDimsOffsets ().size () ||
726- !llvm::equal (llvm::make_range (getStaticShardedDimsOffsets ().begin (),
727- getStaticShardedDimsOffsets ().end ()),
728- llvm::make_range (rhs.getStaticShardedDimsOffsets ().begin (),
729- rhs.getStaticShardedDimsOffsets ().end ()))) {
721+ !llvm::equal (getStaticShardedDimsOffsets (),
722+ rhs.getStaticShardedDimsOffsets ())) {
730723 return false ;
731724 }
732725 if (rhs.getDynamicShardedDimsOffsets ().size () !=
733726 getDynamicShardedDimsOffsets ().size () ||
734- !llvm::equal (
735- llvm::make_range (getDynamicShardedDimsOffsets ().begin (),
736- getDynamicShardedDimsOffsets ().end ()),
737- llvm::make_range (rhs.getDynamicShardedDimsOffsets ().begin (),
738- rhs.getDynamicShardedDimsOffsets ().end ()))) {
727+ !llvm::equal (getDynamicShardedDimsOffsets (),
728+ rhs.getDynamicShardedDimsOffsets ())) {
739729 return false ;
740730 }
741731 return true ;
742732}
743733
744734bool MeshSharding::equalHaloSizes (const MeshSharding &rhs) const {
745735 if (rhs.getStaticHaloSizes ().size () != getStaticHaloSizes ().size () ||
746- !llvm::equal (llvm::make_range (getStaticHaloSizes ().begin (),
747- getStaticHaloSizes ().end ()),
748- llvm::make_range (rhs.getStaticHaloSizes ().begin (),
749- rhs.getStaticHaloSizes ().end ()))) {
736+ !llvm::equal (getStaticHaloSizes (), rhs.getStaticHaloSizes ())) {
750737 return false ;
751738 }
752739 if (rhs.getDynamicHaloSizes ().size () != getDynamicHaloSizes ().size () ||
753- !llvm::equal (llvm::make_range (getDynamicHaloSizes ().begin (),
754- getDynamicHaloSizes ().end ()),
755- llvm::make_range (rhs.getDynamicHaloSizes ().begin (),
756- rhs.getDynamicHaloSizes ().end ()))) {
740+ !llvm::equal (getDynamicHaloSizes (), rhs.getDynamicHaloSizes ())) {
757741 return false ;
758742 }
759743 return true ;
0 commit comments