Files
llvm-6502/test/Transforms/LoopVectorize/X86/ptr-indvar-crash.ll
David Majnemer 8a8d8b3e59 [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
2015-06-27 08:38:17 +00:00

21 lines
540 B
LLVM

; RUN: opt -slp-vectorizer -S %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f(i128 %p1) {
entry:
br label %while.body
while.body:
%p.05 = phi i8* [ %add.ptr, %while.body ], [ null, %entry ]
%p1.addr.04 = phi i128 [ %sub, %while.body ], [ %p1, %entry ]
%add.ptr = getelementptr inbounds i8, i8* %p.05, i32 2
%sub = add nsw i128 %p1.addr.04, -2
%tobool = icmp eq i128 %sub, 0
br i1 %tobool, label %while.end, label %while.body
while.end:
ret void
}