[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass

Sebastian Pop spop at codeaurora.org
Tue Jan 17 12:19:26 PST 2012


On Tue, Jan 17, 2012 at 2:10 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> I will post an updated patch shortly. I have been "stress-testing" the
> patch to ensure correctness, and have corrected a few bugs. The most
> non-trivial issue that I've discovered was the possibility of generating
> non-trivial (meaning > 2 in length) pairing-induced dependency cycles.
> To prevent this from happening I've implemented a cycle check, but this
> increases the algorithmic complexity of the pair-selection process, and
> makes the vectorizer quite slow on some blocks. I can see two ways to
> proceed here:
>  1. Improve the cycle detection algorithm used (for example, I can use
> the algorithm currently used for
> ScheduleDAGTopologicalSort::WillCreateCycle, or something similar).
>  2. Late abort on non-trivial cycles. This will make the fusing process
> more expensive, but will not increase the algorithmic complexity. It
> would, however, degrade the quality of the vectorization, because it
> would mean that pairs otherwise selected for vectorization might, at the
> very end, not end up fused into vector instructions [this seems
> relatively rare, so it might not be a big deal].
>
> The best thing may be to implement both and give the user an option of a
> fast way and a slower way (maybe this can be done post-commit).

Yes, I like the idea of having this code checked in as soon as possible,
as we will be able to keep track more easily of the changes going in to
tune/correct the vectorizer.

Sebastian
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum




More information about the llvm-dev mailing list