llvm-6502/lib/Transforms/Vectorize
Arnold Schwaighofer 07a3c481c6 LoopVectorizer: Extend the induction variable to a larger type
In some case the loop exit count computation can overflow. Extend the type to
prevent most of those cases.

The problem is loops like:
int main ()
{
  int a = 1;
  char b = 0;
  lbl:
    a &= 4;
    b--;
    if (b) goto lbl;
  return a;
}

The backedge count is 255. The induction variable type is i8. If we add one to
255 to get the exit count we overflow to zero.

To work around this issue we extend the type of the induction variable to i32 in
the case of i8 and i16.

PR17532

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195008 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 13:14:32 +00:00
..
BBVectorize.cpp Use more type helper functions 2013-10-21 19:43:56 +00:00
CMakeLists.txt SLP Vectorizer: Implement multi-block slp-vectorization. 2013-06-22 21:34:10 +00:00
LLVMBuild.txt
LoopVectorize.cpp LoopVectorizer: Extend the induction variable to a larger type 2013-11-18 13:14:32 +00:00
Makefile
SLPVectorizer.cpp SLPVectorizer: Use properlyDominates to satisfy the irreflexivity of a strict weak ordering. 2013-11-04 21:34:55 +00:00
Vectorize.cpp This patch breaks up Wrap.h so that it does not have to include all of 2013-05-01 20:59:00 +00:00