File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1896,6 +1896,27 @@ void FlowGraph::removeRedundantLabels() {
1896
1896
}
1897
1897
}
1898
1898
1899
+ // For the code like following, in which the first none-label
1900
+ // instruction is join, and the JIP label of the join is the label of
1901
+ // successor BB, we cannot just remove the label in successor.
1902
+ //
1903
+ // BB17 Preds: ... Succs: BB18
1904
+ // _entry_020_id196_Labe:
1905
+ // join(32) _entry_k0_5_cf
1906
+ // add(16) id265_(0, 0)<1> : d id63_(0, 0) < 1;
1907
+ //
1908
+ // BB18 Preds: BB17 Succs: ...
1909
+ // _entry_k0_5_cf:
1910
+ // ....
1911
+ G4_INST *firstNoneLableInst = singlePred->getFirstInst ();
1912
+ if (firstNoneLableInst && firstNoneLableInst->isFlowControl ()) {
1913
+ G4_Label *jip = firstNoneLableInst->asCFInst ()->getJip ();
1914
+ G4_Label *uip = firstNoneLableInst->asCFInst ()->getUip ();
1915
+ if (jip == labelInst->getLabel () || uip == labelInst->getLabel ()) {
1916
+ doMerging = false ;
1917
+ }
1918
+ }
1919
+
1899
1920
if (doMerging) {
1900
1921
removePredSuccEdges (singlePred, bb);
1901
1922
vASSERT (singlePred->Succs .size () == 0 );
You can’t perform that action at this time.
0 commit comments