Files
swift-mirror/test/IRGen/vector_reduction.swift
Dmitri Hrybenko 5032ea5ae5 Make the test more robust so that it passes with stronger optimizations
in the new LLVM

Swift SVN r29693
2015-06-25 22:01:31 +00:00

19 lines
359 B
Swift

// RUN: %target-swift-frontend -Ounchecked %s -emit-ir | FileCheck %s
// REQUIRES: CPU=x86_64
// We were missing target transform info and not vectorizing the loop below.
// CHECK: xor <2 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
}