diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-08-22 12:45:17 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-08-22 12:45:17 +0000 |
commit | 1c34afcb613f8eafcb9e40b492fbcb743b4fb94c (patch) | |
tree | 38e15100f71897eb700baf73371c16e1ad95028a /clang-tools-extra/Makefile | |
parent | e1de9e9c3314ef55944b163040c2436e827c7172 (diff) | |
download | bcm5719-llvm-1c34afcb613f8eafcb9e40b492fbcb743b4fb94c.tar.gz bcm5719-llvm-1c34afcb613f8eafcb9e40b492fbcb743b4fb94c.zip |
Teach the SLP vectorizer the correct way to check for consecutive access
using GEPs. Previously, it used a number of different heuristics for
analyzing the GEPs. Several of these were conservatively correct, but
failed to fall back to SCEV even when SCEV might have given a reasonable
answer. One was simply incorrect in how it was formulated.
There was good code already to recursively evaluate the constant offsets
in GEPs, look through pointer casts, etc. I gathered this into a form
code like the SLP code can use in a previous commit, which allows all of
this code to become quite simple.
There is some performance (compile time) concern here at first glance as
we're directly attempting to walk both pointers constant GEP chains.
However, a couple of thoughts:
1) The very common cases where there is a dynamic pointer, and a second
pointer at a constant offset (usually a stride) from it, this code
will actually not do any unnecessary work.
2) InstCombine and other passes work very hard to collapse constant
GEPs, so it will be rare that we iterate here for a long time.
That said, if there remain performance problems here, there are some
obvious things that can improve the situation immensely. Doing
a vectorizer-pass-wide memoizer for each individual layer of pointer
values, their base values, and the constant offset is likely to be able
to completely remove redundant work and strictly limit the scaling of
the work to scrape these GEPs. Since this optimization was not done on
the prior version (which would still benefit from it), I've not done it
here. But if folks have benchmarks that slow down it should be straight
forward for them to add.
I've added a test case, but I'm not really confident of the amount of
testing done for different access patterns, strides, and pointer
manipulation.
llvm-svn: 189007
Diffstat (limited to 'clang-tools-extra/Makefile')
0 files changed, 0 insertions, 0 deletions