File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3428,23 +3428,21 @@ void SuperWord::remove_pack_at(int pos) {
34283428
34293429void SuperWord::packset_sort (int n) {
34303430 // simple bubble sort so that we capitalize with O(n) when its already sorted
3431- while (n != 0 ) {
3432- bool swapped = false ;
3431+ do {
3432+ int max_swap_index = 0 ;
34333433 for (int i = 1 ; i < n; i++) {
34343434 Node_List* q_low = _packset.at (i-1 );
34353435 Node_List* q_i = _packset.at (i);
34363436
34373437 // only swap when we find something to swap
34383438 if (alignment (q_low->at (0 )) > alignment (q_i->at (0 ))) {
3439- Node_List* t = q_i;
34403439 *(_packset.adr_at (i)) = q_low;
34413440 *(_packset.adr_at (i-1 )) = q_i;
3442- swapped = true ;
3441+ max_swap_index = i ;
34433442 }
34443443 }
3445- if (swapped == false ) break ;
3446- n--;
3447- }
3444+ n = max_swap_index;
3445+ } while (n > 1 );
34483446}
34493447
34503448LoadNode::ControlDependency SuperWord::control_dependency (Node_List* p) {
You can’t perform that action at this time.
0 commit comments