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

Hal Finkel hfinkel at anl.gov
Tue Jan 17 16:22:16 PST 2012


On Tue, 2012-01-17 at 14:19 -0600, Sebastian Pop wrote:
> 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.

I do as well. I still have a few more tests that I'd like to write (like
for the shuffle pairings), and I'll include your test, and then it
should be ready to commit (as Tobias suggested, once I post that
version, I'll give people a few days to object before I actually
commit). In the mean time, I've attached my latest version.

Thanks again,
Hal

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

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_bb_vectorize-20120117.diff
Type: text/x-patch
Size: 119820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120117/7d1bead5/attachment.bin>


More information about the llvm-commits mailing list