[PATCH] D111125: [NFC][LoopVectorize] Remove setBestPlan in favour of getBestPlanFor

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 10:14:25 PDT 2021


david-arm added a comment.

Hi @bmahjour, thanks a lot for sharing a patch to change the interfaces!

To address @sdesmalen's point that removePlansExcept introduces complexity to reduce the lifetime of vplans when their short lifetime may not have a noticable impact on memory usage, I did an experiment where I built the LLVM test suite with two versions of this patch: 1) Patch A that keeps all the vplans, 2) Patch B that removes the unneeded vplans. I recorded the memory usage of each compilation using `/usr/bin/time -v` and extracted the maximum resident memory each time. I then took the average of all these values to determine the average maximum resident memory usage. I found practically no difference in peak memory consumption between Patch A and B.

One benefit from keeping all vplans until after code-generation is that we avoid having to structure the code in a certain way (i.e. having to decide on all relevant vplans first, before removing the unnecessary ones and doing code-gen for the selected plans) and the code will look more natural. I also wondered if there would ever be a situation in future where we might need three or more plans? I realise it's a bit of a stretch, but I could imagine more layers, i.e. a main vector loop, a vector epilogue, and a predicated vector tail.

Anyway, any thoughts you have are appreciated!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111125/new/

https://reviews.llvm.org/D111125



More information about the llvm-commits mailing list