llvm-6502/lib/Transforms
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
..
Hello First check in. Modified a comment. 2013-09-27 07:36:10 +00:00
InstCombine Apply the InstCombine fptrunc sqrt optimization to llvm.sqrt 2013-11-16 21:29:08 +00:00
Instrumentation [asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a bit of code size 2013-11-15 09:52:05 +00:00
IPO Add a loop rerolling flag to the PassManagerBuilder 2013-11-17 16:02:50 +00:00
ObjCARC [objc-arc] Convert the one directional retain/release relation assert to a conditional check + fail. 2013-11-05 16:02:40 +00:00
Scalar Fix ndebug-build unused variable in loop rerolling 2013-11-17 01:21:54 +00:00
Utils Utils/LoopUnroll.cpp: Tweak (StringRef)OldName to be valid until it is used, since r194601. 2013-11-17 18:05:34 +00:00
Vectorize LoopVectorizer: Extend the induction variable to a larger type 2013-11-18 13:14:32 +00:00
CMakeLists.txt Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00
LLVMBuild.txt Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00
Makefile Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer. 2013-01-28 01:35:51 +00:00