- Fix potential issue with MAX and MIN elements in array (that should be always one of array elements).
- Based on https://reviews.llvm.org/D18158 it turned out that currently bubble sort is a flaky test.
The flakiness caused by unpredictable memory accesses to array and code:
if (a[i] > a[i + 1) { load a[i], a[i+1];
store to a[i], a[i+1];
}
Making stores unconditional will simplify memory accesses and potentially CFG.
This will open the test for compiler optimizations (like unroll, scalar replacement, if conversion...).
Generally the idea to convert the test from memory test to compiler test.
I don't understand why this change? (i.e. it should be at least documented).