[PATCH] D120215: [LV] Invalidate widening decisions after maximizing vector bandwidth

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 20 10:54:56 PST 2022


dmgreen created this revision.
dmgreen added reviewers: fhahn, Ayal, sdesmalen.
Herald added a subscriber: hiraditya.
dmgreen requested review of this revision.
Herald added a project: LLVM.

When MaximizeVectorBandwidth is enabled, we can end up (via calls to collectUniformsAndScalars/setCostBasedWideningDecision through calculateRegisterUsage) making widening decisions before we have decided whether to fold the tail by masking. These decisions will be wrong if we later decided to fold the tail, for example when the trip count is very low. It will use incorrect costs for loads that should get masked, using standard memory operation costs instead.

This still now the EmulatedMaskMemRefHack costs (a bit unfortunately), but the old costs without this change were 1, leading to too optimistic vectorization.

This slightly changes the way that the MaximizeVectorBandwidth option works to make it easier to test, always honouring the option if it is set.


https://reviews.llvm.org/D120215

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/maximize-bandwidth-invalidate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120215.410169.patch
Type: text/x-patch
Size: 9238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220220/4200e008/attachment.bin>


More information about the llvm-commits mailing list