Files
swift-mirror/test/IRGen/inout_noalias.swift
Nate Chandler d70d3919a6 [IRGen] Mark inout ptrs noalias.
Thanks to exclusivity checking, inout arguments can be marked noalias.
In the fullness of time, this should be applied in general.

As an incremental step towards marking all such arguments noalias, start
by marking inout arguments of pointer type noalias.  Take this
conservative step rather than always applying the attribute to ward
against issues with LLVM's alias analysis.

rdar://76540030
2022-04-20 16:58:08 -07:00

6 lines
273 B
Swift

// RUN: %target-swift-frontend %s -emit-ir | %FileCheck %s
// CHECK: define{{.*}}swiftcc void @swapPointers({{.*}}noalias{{.*}},{{.*}}noalias{{.*}})
@_silgen_name("swapPointers")
public func swapPointers<T>(_ lhs: inout UnsafePointer<T>, _ rhs: inout UnsafePointer<T>) {}