[PATCH] D24593: Standford/Bubble sort code restructure

Evgeny Stupachenko via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 17:19:03 PDT 2016


evstupac updated this revision to Diff 71465.
evstupac added a comment.

Keep only flakiness fix.


https://reviews.llvm.org/D24593

Files:
  SingleSource/Benchmarks/Stanford/Bubblesort.c

Index: SingleSource/Benchmarks/Stanford/Bubblesort.c
===================================================================
--- SingleSource/Benchmarks/Stanford/Bubblesort.c
+++ SingleSource/Benchmarks/Stanford/Bubblesort.c
@@ -148,11 +148,15 @@
 		i=1;
 		while ( i<top ) {
 			
-			if ( sortlist[i] > sortlist[i+1] ) {
-				j = sortlist[i];
-				sortlist[i] = sortlist[i+1];
-				sortlist[i+1] = j;
+			int sli = sortlist[i];
+			int sli1 = sortlist[i + 1];
+			if ( sli > sli1 ) {
+				j = sli;
+				sli = sli1;
+				sli1 = j;
 			}
+			sortlist[i] = sli;
+			sortlist[i + 1] = sli1;
 			i=i+1;
 		}
 		


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24593.71465.patch
Type: text/x-patch
Size: 604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160915/caa17d63/attachment.bin>


More information about the llvm-commits mailing list