[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)
commit9f3979fd782dc823cc0cdf38c69a14812e5254a8
treeaef23faf69c6eeeaaa2b04b94bc8217ef6b82860
parent5185c3c271418eeac9ce8588210c9e103cdd08d4
[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.

llvm-svn: 240877
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/X86/ptr-indvar-crash.ll [new file with mode: 0644]