File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2939,6 +2939,29 @@ void RegReductionPQBase::PrescheduleNodesWithMultipleUses() {
2939
2939
(cast<RegisterSDNode>(N->getOperand (1 ))->getReg ()))
2940
2940
continue ;
2941
2941
2942
+ SDNode *PredFrameSetup = nullptr ;
2943
+ for (const SDep &Pred : SU.Preds )
2944
+ if (Pred.isCtrl () && Pred.getSUnit ()) {
2945
+ // Find the predecessor which is not data dependence.
2946
+ SDNode *PredND = Pred.getSUnit ()->getNode ();
2947
+
2948
+ // If PredND is FrameSetup, we should not pre-scheduled the node,
2949
+ // or else, when bottom up scheduling, ADJCALLSTACKDOWN and
2950
+ // ADJCALLSTACKUP may hold CallResource too long and make other
2951
+ // calls can't be scheduled. If there's no other available node
2952
+ // to schedule, the schedular will try to rename the register by
2953
+ // creating copy to avoid the conflict which will fail because
2954
+ // CallResource is not a real physical register.
2955
+ if (PredND && PredND->isMachineOpcode () &&
2956
+ (PredND->getMachineOpcode () == TII->getCallFrameSetupOpcode ())) {
2957
+ PredFrameSetup = PredND;
2958
+ break ;
2959
+ }
2960
+ }
2961
+ // Skip the node has FrameSetup parent.
2962
+ if (PredFrameSetup != nullptr )
2963
+ continue ;
2964
+
2942
2965
// Locate the single data predecessor.
2943
2966
SUnit *PredSU = nullptr ;
2944
2967
for (const SDep &Pred : SU.Preds )
You can’t perform that action at this time.
0 commit comments