@@ -3825,12 +3825,17 @@ class VPlan {
3825
3825
VPBasicBlock *getEntry () { return Entry; }
3826
3826
const VPBasicBlock *getEntry () const { return Entry; }
3827
3827
3828
- // / Return the VPIRBasicBlock wrapping the header of the scalar loop.
3829
- VPIRBasicBlock *getScalarHeader () const { return ScalarHeader; }
3828
+ // / Returns the preheader of the vector loop region.
3829
+ VPBasicBlock *getVectorPreheader () {
3830
+ return cast<VPBasicBlock>(getVectorLoopRegion ()->getSinglePredecessor ());
3831
+ }
3830
3832
3831
- // / Return the VPBasicBlock for the preheader of the scalar loop.
3832
- VPBasicBlock *getScalarPreheader () const {
3833
- return cast<VPBasicBlock>(ScalarHeader->getSinglePredecessor ());
3833
+ // / Returns the VPRegionBlock of the vector loop.
3834
+ VPRegionBlock *getVectorLoopRegion () {
3835
+ return cast<VPRegionBlock>(getEntry ()->getSingleSuccessor ());
3836
+ }
3837
+ const VPRegionBlock *getVectorLoopRegion () const {
3838
+ return cast<VPRegionBlock>(getEntry ()->getSingleSuccessor ());
3834
3839
}
3835
3840
3836
3841
// / Returns the 'middle' block of the plan, that is the block that selects
@@ -3843,6 +3848,14 @@ class VPlan {
3843
3848
return cast<VPBasicBlock>(getVectorLoopRegion ()->getSingleSuccessor ());
3844
3849
}
3845
3850
3851
+ // / Return the VPBasicBlock for the preheader of the scalar loop.
3852
+ VPBasicBlock *getScalarPreheader () const {
3853
+ return cast<VPBasicBlock>(ScalarHeader->getSinglePredecessor ());
3854
+ }
3855
+
3856
+ // / Return the VPIRBasicBlock wrapping the header of the scalar loop.
3857
+ VPIRBasicBlock *getScalarHeader () const { return ScalarHeader; }
3858
+
3846
3859
// / Return an iterator range over the VPIRBasicBlock wrapping the exit blocks
3847
3860
// / of the VPlan, that is leaf nodes except the scalar header. Defined in
3848
3861
// / VPlanHCFG, as the definition of the type needs access to the definitions
@@ -3953,19 +3966,6 @@ class VPlan {
3953
3966
LLVM_DUMP_METHOD void dump () const ;
3954
3967
#endif
3955
3968
3956
- // / Returns the VPRegionBlock of the vector loop.
3957
- VPRegionBlock *getVectorLoopRegion () {
3958
- return cast<VPRegionBlock>(getEntry ()->getSingleSuccessor ());
3959
- }
3960
- const VPRegionBlock *getVectorLoopRegion () const {
3961
- return cast<VPRegionBlock>(getEntry ()->getSingleSuccessor ());
3962
- }
3963
-
3964
- // / Returns the preheader of the vector loop region.
3965
- VPBasicBlock *getVectorPreheader () {
3966
- return cast<VPBasicBlock>(getVectorLoopRegion ()->getSinglePredecessor ());
3967
- }
3968
-
3969
3969
// / Returns the canonical induction recipe of the vector loop.
3970
3970
VPCanonicalIVPHIRecipe *getCanonicalIV () {
3971
3971
VPBasicBlock *EntryVPBB = getVectorLoopRegion ()->getEntryBasicBlock ();
0 commit comments