[PATCH] D19984: [LV] Handle RAW dependences in interleaved access analysis

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 10:48:48 PDT 2016


mssimpso created this revision.
mssimpso added reviewers: sbaranga, anemet, hfinkel.
mssimpso added subscribers: mcrosier, llvm-commits.
Herald added a subscriber: mzolotukhin.

The interleaved access analysis currently assumes the absence of read-after-write dependences. While this is true of loop-carried dependences, we can still encounter loop-independent dependences that can cause problems for interleaved accesses.

The problems arise from how code generation is performed for the interleaved groups. For a load group, all loads in the group are essentially "moved" to the location of the first load, and for a store group, all stores in the group are "moved" to the location of the last store. For groups having members involved in a read-after-write dependence, this reordering of loads and stores will violate the dependence.

This patch teaches the interleaved access analysis how to avoid breaking such dependences. The fact that store groups having gaps are scalarized simplifies things: I think we only need to consider zero-distance dependences.

An assumption of the original analysis was that the accesses had been collected in "program order". The analysis was then simplified by visiting the accesses bottom-up. However, this ordering was never guaranteed for anything other than single basic block loops. Thus, this patch also enforces the desired ordering.

This should fix PR27626.

http://reviews.llvm.org/D19984

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/interleaved-accesses.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19984.56312.patch
Type: text/x-patch
Size: 13290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/0bbd5ea4/attachment.bin>


More information about the llvm-commits mailing list