On Mon, 6 Feb 2023 17:39:42 GMT, Paul Sandoz <psan...@openjdk.org> wrote:
>> Xiaohong Gong has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add smaller array size for benchmark tests > > I think it would be useful to adjust the naming and comments of some methods > to make it clearer the method parameter constraints. > > `indexInRange0Helper` is now called if the index is partially or totally out > of range at the lower or upper ends and `indexInRange0` is called if > partially or totally out of range at the upper end. > e.g. a more literal naming could be: > `AbstractMask::indexInRange0Helper` -> > `AbstractMask::indexPartiallyInRangeHelper` > `VectorSupport::indexInRange` -> VectorSupport::indexPartiallyInUpperRange` > ? > > IIUC the performance numbers show that when the array is not a multiple of > the vector size there is still quite an impact overall to calling > `VectorSupport::indexInRange` for the last loop iteration. I am guessing the > overall loop shape is different which impacts other optimizations? > > To do this more optimally likely requires a loop transformation where the > last loop iteration is peeled off, but that's a harder transformation in one > of the more complicated areas of C2 (although it already supports pre/post > loop, so maybe its possible to leverage that?). Thanks for the review @PaulSandoz ! ------------- PR: https://git.openjdk.org/jdk/pull/12064