[LoopVectorize] Pointer indicies may be wider than the pointer
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 27 Jun 2015 08:38:17 +0000 (08:38 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 27 Jun 2015 08:38:17 +0000 (08:38 +0000)
commit8a8d8b3e594e0e4e125d15766f24e5f7aa43d073
tree110b5653aa6e6141919ac8734611996c5b7f0b11
parent1166ce2460d5b47d7f5e1694b6645f0156ca4dfc
[LoopVectorize] Pointer indicies may be wider than the pointer

If we are dealing with a pointer induction variable, isInductionPHI
gives back a step value of Stride / size of pointer.  However, we might
be indexing with a legal type wider than the pointer width.
Handle this by inserting casts where appropriate instead of crashing.

This fixes PR23954.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240877 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/ptr-indvar-crash.ll [new file with mode: 0644]