On the attached test, the LoopUnrollPass fails to unroll the loop because its trip count is not constant. %0 = select i1 %cond, i32 2, i32 3
In order to unroll the loop, we need to set up UP.UpperBound = true in getUnrollingPreferences.
Currently, it is enabled with certain target condition on AArch64 target. This patch enables it universally for AArch64 target.
The performance data from spec2017 is as below.
Benchmark diff (%) 500.perlbench_r 1.226130632 502.gcc_r 0.22529927 505.mcf_r 0.00061882 520.omnetpp_r -0.094707343 523.xalancbmk_r -0.125968029 525.x264_r 0.45726427 531.deepsjeng_r 0.326290873 541.leela_r -0.047175519 548.exchange2_r 0.101954068 557.xz_r 0.275802637
This is vague and without the context of this patch not so informative:
I'd say just get rid of this part.