Files
swift-mirror/test/IRGen/vector_reduction.swift
Michael Gottesman fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00

22 lines
420 B
Swift

// RUN: %target-swift-frontend -Ounchecked %s -emit-ir | %FileCheck %s
// REQUIRES: CPU=x86_64
// rdar://30579970
// REQUIRES: optimized_stdlib
// We were missing target transform info and not vectorizing the loop below.
// CHECK: xor <{{(2|4|8)}} x i64>
public func f(a: UnsafePointer<Int>, b: UnsafePointer<Int>, count: Int) -> Int {
var c = 0
for i in 0..<count {
c = a[i] ^ b[i] ^ c
}
return c
}