llvm-6502/lib
Chandler Carruth 474be0d0f8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 12:45:17 +00:00
..
Analysis Reorder headers according to lint. 2013-08-21 21:14:19 +00:00
AsmParser
Bitcode
CodeGen [stackprotector] When finding the split point to splice off the end of a parentmbb into a successmbb, include any DBG_VALUE MI. 2013-08-22 05:40:50 +00:00
DebugInfo llvm-dwarfdump: Do not include address offsets for attributes, only for tags 2013-08-19 03:36:23 +00:00
ExecutionEngine Reorder headers according to lint. 2013-08-21 21:14:19 +00:00
IR Add a new helper method to Value to strip in-bounds constant offsets of 2013-08-22 11:25:11 +00:00
IRReader
Linker
MC MC CFG: Remap enough for data too, analoguous to r188873. 2013-08-21 19:40:28 +00:00
Object Move #includes from .h to .cpp file. 2013-08-21 01:20:11 +00:00
Option Options: explicit handling of -- 2013-08-13 22:23:05 +00:00
Support MemoryBuffer.cpp: Consider if PageSize were not 4096 in shouldUseMmap(). Follow-up to r188903. 2013-08-22 10:23:52 +00:00
TableGen Add an error check for a typo I accidentally made in a td file that caused an assert to fire. 2013-08-20 04:22:09 +00:00
Target [ARM] Constrain some register classes in EmitAtomicBinary64 so that 2013-08-22 12:19:24 +00:00
Transforms Teach the SLP vectorizer the correct way to check for consecutive access 2013-08-22 12:45:17 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile