; RUN: opt -basicaa -slp-vectorizer -mtriple=x86_64-apple-macosx10.9.0 -mcpu=corei7-avx -S < %s | FileCheck %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" ; This test used to crash because we were following phi chains incorrectly. ; We used indices to get the incoming value of two phi nodes rather than ; incoming block lookup. ; This can give wrong results when the ordering of incoming ; edges in the two phi nodes don't match. ;CHECK-LABEL: bar %0 = type { %1, %2 } %1 = type { double, double } %2 = type { double, double } ;define fastcc void @bar() { define void @bar() { %1 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 %2 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 %3 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 %4 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 %5 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 %6 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 br label %7 ;