Skip to content

Instantly share code, notes, and snippets.

@dan-zheng
Last active July 14, 2018 01:34
Show Gist options
  • Save dan-zheng/0526988f83bf3a10082811816bc8f511 to your computer and use it in GitHub Desktop.
Save dan-zheng/0526988f83bf3a10082811816bc8f511 to your computer and use it in GitHub Desktop.
import TensorFlow
func test(_ array: [Tensor<Float>]) {
for (i, x) in array.enumerated() {
print(x + x)
}
}
test([Tensor(1), Tensor(2)])
  • Changing for (i, x) in array.enumerated() to for x in array doesn't produce this crasher. Instead, it produces an error (which is good).
enumerated.swift:4:9: error: #tfop invalid: FIXME: cannot lower a Host->TF tensor transfer in a loop header
  for x in array {
  • Changing print(x + x) to print(x) makes the program compile and run successfully.
$ swift -O enumerated.swift
enumerated.swift:4:8: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
  for (i, x) in array.enumerated() {
       ^
       _
1.0
2.0
$ swift -Xllvm -tf-dump-intermediates -O enumerated.swift
--- TFDeabstraction Input: main
// main
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
%2 = integer_literal $Builtin.Word, 2 // user: %4
// function_ref _allocateUninitializedArray<A>(_:)
%3 = function_ref @$Ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %4
%4 = apply %3<Tensor<Float>>(%2) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %8, %5, %7
%5 = tuple_extract %4 : $(Array<Tensor<Float>>, Builtin.RawPointer), 0 // users: %31, %32, %6
retain_value %5 : $Array<Tensor<Float>> // id: %6
%7 = tuple_extract %4 : $(Array<Tensor<Float>>, Builtin.RawPointer), 1 // user: %9
release_value %4 : $(Array<Tensor<Float>>, Builtin.RawPointer) // id: %8
%9 = pointer_to_address %7 : $Builtin.RawPointer to [strict] $*Tensor<Float> // users: %18, %20
%10 = metatype $@thin Tensor<Float>.Type // user: %16
%11 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %12
%12 = struct $Float (%11 : $Builtin.FPIEEE32) // user: %14
%13 = alloc_stack $Float // users: %14, %17, %16
store %12 to %13 : $*Float // id: %14
// function_ref Tensor.init(_:)
%15 = function_ref @$S10TensorFlow0A0VyACyxGxcfC : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@in τ_0_0, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // user: %16
%16 = apply %15<Float>(%13, %10) : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@in τ_0_0, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // user: %18
dealloc_stack %13 : $*Float // id: %17
store %16 to %9 : $*Tensor<Float> // id: %18
%19 = integer_literal $Builtin.Word, 1 // user: %20
%20 = index_addr %9 : $*Tensor<Float>, %19 : $Builtin.Word // user: %29
%21 = metatype $@thin Tensor<Float>.Type // user: %27
%22 = float_literal $Builtin.FPIEEE32, 0x40000000 // 2 // user: %23
%23 = struct $Float (%22 : $Builtin.FPIEEE32) // user: %25
%24 = alloc_stack $Float // users: %25, %28, %27
store %23 to %24 : $*Float // id: %25
// function_ref Tensor.init(_:)
%26 = function_ref @$S10TensorFlow0A0VyACyxGxcfC : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@in τ_0_0, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // user: %27
%27 = apply %26<Float>(%24, %21) : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@in τ_0_0, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // user: %29
dealloc_stack %24 : $*Float // id: %28
store %27 to %20 : $*Tensor<Float> // id: %29
// function_ref test(_:)
%30 = function_ref @$S10enumerated4testyySay10TensorFlow0C0VySfGGF : $@convention(thin) (@guaranteed Array<Tensor<Float>>) -> () // user: %31
%31 = apply %30(%5) : $@convention(thin) (@guaranteed Array<Tensor<Float>>) -> ()
release_value %5 : $Array<Tensor<Float>> // id: %32
%33 = integer_literal $Builtin.Int32, 0 // user: %34
%34 = struct $Int32 (%33 : $Builtin.Int32) // user: %35
return %34 : $Int32 // id: %35
} // end sil function 'main'
----
--- TFDeabstraction Result: main
// main
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
%2 = integer_literal $Builtin.Word, 2 // users: %8, %3
%3 = builtin "zextOrBitCast_Word_Int64"(%2 : $Builtin.Word) : $Builtin.Int64 // users: %6, %4
%4 = struct $Int (%3 : $Builtin.Int64) // users: %22, %11
%5 = integer_literal $Builtin.Int64, 0 // user: %6
%6 = builtin "cmp_slt_Int64"(%5 : $Builtin.Int64, %3 : $Builtin.Int64) : $Builtin.Int1 // user: %7
cond_br %6, bb1, bb3 // id: %7
bb1: // Preds: bb0
%8 = alloc_ref [tail_elems $Tensor<Float> * %2 : $Builtin.Word] $_ContiguousArrayStorage<Tensor<Float>> // user: %11
%9 = metatype $@thin Array<Tensor<Float>>.Type // user: %11
// function_ref static Array._adoptStorage(_:count:)
%10 = function_ref @$SSa13_adoptStorage_5countSayxG_SpyxGts016_ContiguousArrayB0CyxGn_SitFZ : $@convention(method) <τ_0_0> (@owned _ContiguousArrayStorage<τ_0_0>, Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // user: %11
%11 = apply %10<Tensor<Float>>(%8, %4, %9) : $@convention(method) <τ_0_0> (@owned _ContiguousArrayStorage<τ_0_0>, Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // users: %13, %12
%12 = tuple_extract %11 : $(Array<Tensor<Float>>, UnsafeMutablePointer<Tensor<Float>>), 0 // user: %15
%13 = tuple_extract %11 : $(Array<Tensor<Float>>, UnsafeMutablePointer<Tensor<Float>>), 1 // user: %14
%14 = struct_extract %13 : $UnsafeMutablePointer<Tensor<Float>>, #UnsafeMutablePointer._rawValue // user: %15
br bb2(%12 : $Array<Tensor<Float>>, %14 : $Builtin.RawPointer) // id: %15
// %16 // user: %18
// %17 // user: %18
bb2(%16 : $Array<Tensor<Float>>, %17 : $Builtin.RawPointer): // Preds: bb3 bb1
%18 = tuple (%16 : $Array<Tensor<Float>>, %17 : $Builtin.RawPointer) // user: %19
br bb4(%18 : $(Array<Tensor<Float>>, Builtin.RawPointer)) // id: %19
bb3: // Preds: bb0
%20 = metatype $@thin Array<Tensor<Float>>.Type // user: %22
// function_ref static Array._allocateUninitialized(_:)
%21 = function_ref @$SSa22_allocateUninitializedySayxG_SpyxGtSiFZ : $@convention(method) <τ_0_0> (Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // user: %22
%22 = apply %21<Tensor<Float>>(%4, %20) : $@convention(method) <τ_0_0> (Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // users: %24, %23
%23 = tuple_extract %22 : $(Array<Tensor<Float>>, UnsafeMutablePointer<Tensor<Float>>), 0 // user: %26
%24 = tuple_extract %22 : $(Array<Tensor<Float>>, UnsafeMutablePointer<Tensor<Float>>), 1 // user: %25
%25 = struct_extract %24 : $UnsafeMutablePointer<Tensor<Float>>, #UnsafeMutablePointer._rawValue // user: %26
br bb2(%23 : $Array<Tensor<Float>>, %25 : $Builtin.RawPointer) // id: %26
// %27 // users: %37, %36, %28
bb4(%27 : $(Array<Tensor<Float>>, Builtin.RawPointer)): // Preds: bb2
%28 = tuple_extract %27 : $(Array<Tensor<Float>>, Builtin.RawPointer), 0 // users: %830, %29, %77, %73
%29 = struct_extract %28 : $Array<Tensor<Float>>, #Array._buffer // user: %30
%30 = struct_extract %29 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %31
%31 = struct_extract %30 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %33, %32
strong_retain %31 : $Builtin.BridgeObject // id: %32
%33 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%31 : $Builtin.BridgeObject) // user: %34
%34 = struct $_ArrayBuffer<Tensor<Float>> (%33 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %35
%35 = struct $Array<Tensor<Float>> (%34 : $_ArrayBuffer<Tensor<Float>>)
%36 = tuple_extract %27 : $(Array<Tensor<Float>>, Builtin.RawPointer), 1 // user: %42
%37 = tuple_extract %27 : $(Array<Tensor<Float>>, Builtin.RawPointer), 0 // user: %38
%38 = struct_extract %37 : $Array<Tensor<Float>>, #Array._buffer // user: %39
%39 = struct_extract %38 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %40
%40 = struct_extract %39 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %41
strong_release %40 : $Builtin.BridgeObject // id: %41
%42 = pointer_to_address %36 : $Builtin.RawPointer to [strict] $*Tensor<Float> // users: %56, %58
%43 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %44
%44 = builtin "__tfop_tfc.scalarToTensor,$in"(%43 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %55, %54, %49, %47, %48
%45 = alloc_stack $Tensor<Float> // users: %46, %50, %53
%46 = struct_element_addr %45 : $*Tensor<Float>, #Tensor.handle // user: %47
store %44 to %46 : $*TensorHandle<Float> // id: %47
%48 = struct $Tensor<Float> (%44 : $TensorHandle<Float>) // user: %56
strong_retain %44 : $TensorHandle<Float> // id: %49
%50 = load %45 : $*Tensor<Float> // user: %51
%51 = struct_extract %50 : $Tensor<Float>, #Tensor.handle // user: %52
strong_release %51 : $TensorHandle<Float> // id: %52
dealloc_stack %45 : $*Tensor<Float> // id: %53
strong_retain %44 : $TensorHandle<Float> // id: %54
strong_release %44 : $TensorHandle<Float> // id: %55
store %48 to %42 : $*Tensor<Float> // id: %56
%57 = integer_literal $Builtin.Word, 1 // user: %58
%58 = index_addr %42 : $*Tensor<Float>, %57 : $Builtin.Word // user: %72
%59 = float_literal $Builtin.FPIEEE32, 0x40000000 // 2 // user: %60
%60 = builtin "__tfop_tfc.scalarToTensor,$in"(%59 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %71, %70, %65, %63, %64
%61 = alloc_stack $Tensor<Float> // users: %62, %66, %69
%62 = struct_element_addr %61 : $*Tensor<Float>, #Tensor.handle // user: %63
store %60 to %62 : $*TensorHandle<Float> // id: %63
%64 = struct $Tensor<Float> (%60 : $TensorHandle<Float>) // user: %72
strong_retain %60 : $TensorHandle<Float> // id: %65
%66 = load %61 : $*Tensor<Float> // user: %67
%67 = struct_extract %66 : $Tensor<Float>, #Tensor.handle // user: %68
strong_release %67 : $TensorHandle<Float> // id: %68
dealloc_stack %61 : $*Tensor<Float> // id: %69
strong_retain %60 : $TensorHandle<Float> // id: %70
strong_release %60 : $TensorHandle<Float> // id: %71
store %64 to %58 : $*Tensor<Float> // id: %72
debug_value %28 : $Array<Tensor<Float>>, let, name "array", argno 1 // id: %73
%74 = alloc_stack $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // users: %415, %192, %422, %214
%75 = alloc_stack $EnumeratedSequence<Array<Tensor<Float>>> // users: %99, %210, %109
%76 = alloc_stack $Array<Tensor<Float>> // users: %80, %108, %77
store %28 to %76 : $*Array<Tensor<Float>> // id: %77
%78 = alloc_stack $EnumeratedSequence<Array<Tensor<Float>>> // users: %100, %89, %106, %79
%79 = struct_element_addr %78 : $*EnumeratedSequence<Array<Tensor<Float>>>, #EnumeratedSequence._base // user: %88
%80 = load %76 : $*Array<Tensor<Float>> // users: %81, %88
%81 = struct_extract %80 : $Array<Tensor<Float>>, #Array._buffer // user: %82
%82 = struct_extract %81 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %83
%83 = struct_extract %82 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %85, %84
strong_retain %83 : $Builtin.BridgeObject // id: %84
%85 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%83 : $Builtin.BridgeObject) // user: %86
%86 = struct $_ArrayBuffer<Tensor<Float>> (%85 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %87
%87 = struct $Array<Tensor<Float>> (%86 : $_ArrayBuffer<Tensor<Float>>)
store %80 to %79 : $*Array<Tensor<Float>> // id: %88
%89 = load %78 : $*EnumeratedSequence<Array<Tensor<Float>>> // users: %90, %99
%90 = struct_extract %89 : $EnumeratedSequence<Array<Tensor<Float>>>, #EnumeratedSequence._base // user: %91
%91 = struct_extract %90 : $Array<Tensor<Float>>, #Array._buffer // user: %92
%92 = struct_extract %91 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %93
%93 = struct_extract %92 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %95, %94
strong_retain %93 : $Builtin.BridgeObject // id: %94
%95 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%93 : $Builtin.BridgeObject) // user: %96
%96 = struct $_ArrayBuffer<Tensor<Float>> (%95 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %97
%97 = struct $Array<Tensor<Float>> (%96 : $_ArrayBuffer<Tensor<Float>>) // user: %98
%98 = struct $EnumeratedSequence<Array<Tensor<Float>>> (%97 : $Array<Tensor<Float>>)
store %89 to %75 : $*EnumeratedSequence<Array<Tensor<Float>>> // id: %99
%100 = load %78 : $*EnumeratedSequence<Array<Tensor<Float>>> // user: %101
%101 = struct_extract %100 : $EnumeratedSequence<Array<Tensor<Float>>>, #EnumeratedSequence._base // user: %102
%102 = struct_extract %101 : $Array<Tensor<Float>>, #Array._buffer // user: %103
%103 = struct_extract %102 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %104
%104 = struct_extract %103 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %105
strong_release %104 : $Builtin.BridgeObject // id: %105
dealloc_stack %78 : $*EnumeratedSequence<Array<Tensor<Float>>> // id: %106
%107 = tuple ()
dealloc_stack %76 : $*Array<Tensor<Float>> // id: %108
%109 = load %75 : $*EnumeratedSequence<Array<Tensor<Float>>> // user: %111
%110 = alloc_stack $EnumeratedSequence<Array<Tensor<Float>>> // users: %203, %209, %113, %111
store %109 to %110 : $*EnumeratedSequence<Array<Tensor<Float>>> // id: %111
%112 = alloc_stack $IndexingIterator<Array<Tensor<Float>>> // users: %172, %154, %201
%113 = struct_element_addr %110 : $*EnumeratedSequence<Array<Tensor<Float>>>, #EnumeratedSequence._base // user: %115
%114 = alloc_stack $Array<Tensor<Float>> // users: %155, %126, %123, %167
%115 = load %113 : $*Array<Tensor<Float>> // users: %116, %123
%116 = struct_extract %115 : $Array<Tensor<Float>>, #Array._buffer // user: %117
%117 = struct_extract %116 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %118
%118 = struct_extract %117 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %120, %119
strong_retain %118 : $Builtin.BridgeObject // id: %119
%120 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%118 : $Builtin.BridgeObject) // user: %121
%121 = struct $_ArrayBuffer<Tensor<Float>> (%120 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %122
%122 = struct $Array<Tensor<Float>> (%121 : $_ArrayBuffer<Tensor<Float>>)
store %115 to %114 : $*Array<Tensor<Float>> // id: %123
%124 = alloc_stack $IndexingIterator<Array<Tensor<Float>>> // users: %160, %143, %166, %140, %125
%125 = struct_element_addr %124 : $*IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %134
%126 = load %114 : $*Array<Tensor<Float>> // users: %127, %134
%127 = struct_extract %126 : $Array<Tensor<Float>>, #Array._buffer // user: %128
%128 = struct_extract %127 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %129
%129 = struct_extract %128 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %131, %130
strong_retain %129 : $Builtin.BridgeObject // id: %130
%131 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%129 : $Builtin.BridgeObject) // user: %132
%132 = struct $_ArrayBuffer<Tensor<Float>> (%131 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %133
%133 = struct $Array<Tensor<Float>> (%132 : $_ArrayBuffer<Tensor<Float>>)
store %126 to %125 : $*Array<Tensor<Float>> // id: %134
%135 = alloc_stack $Int // users: %142, %141, %138
%136 = integer_literal $Builtin.Int64, 0 // user: %137
%137 = struct $Int (%136 : $Builtin.Int64) // user: %138
store %137 to %135 : $*Int // id: %138
%139 = tuple ()
%140 = struct_element_addr %124 : $*IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._position // user: %141
copy_addr [take] %135 to [initialization] %140 : $*Int // id: %141
dealloc_stack %135 : $*Int // id: %142
%143 = load %124 : $*IndexingIterator<Array<Tensor<Float>>> // users: %152, %144, %154
%144 = struct_extract %143 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %145
%145 = struct_extract %144 : $Array<Tensor<Float>>, #Array._buffer // user: %146
%146 = struct_extract %145 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %147
%147 = struct_extract %146 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %149, %148
strong_retain %147 : $Builtin.BridgeObject // id: %148
%149 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%147 : $Builtin.BridgeObject) // user: %150
%150 = struct $_ArrayBuffer<Tensor<Float>> (%149 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %151
%151 = struct $Array<Tensor<Float>> (%150 : $_ArrayBuffer<Tensor<Float>>) // user: %153
%152 = struct_extract %143 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._position // user: %153
%153 = struct $IndexingIterator<Array<Tensor<Float>>> (%151 : $Array<Tensor<Float>>, %152 : $Int)
store %143 to %112 : $*IndexingIterator<Array<Tensor<Float>>> // id: %154
%155 = load %114 : $*Array<Tensor<Float>> // user: %156
%156 = struct_extract %155 : $Array<Tensor<Float>>, #Array._buffer // user: %157
%157 = struct_extract %156 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %158
%158 = struct_extract %157 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %159
strong_release %158 : $Builtin.BridgeObject // id: %159
%160 = load %124 : $*IndexingIterator<Array<Tensor<Float>>> // user: %161
%161 = struct_extract %160 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %162
%162 = struct_extract %161 : $Array<Tensor<Float>>, #Array._buffer // user: %163
%163 = struct_extract %162 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %164
%164 = struct_extract %163 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %165
strong_release %164 : $Builtin.BridgeObject // id: %165
dealloc_stack %124 : $*IndexingIterator<Array<Tensor<Float>>> // id: %166
dealloc_stack %114 : $*Array<Tensor<Float>> // id: %167
%168 = tuple ()
%169 = tuple ()
%170 = alloc_stack $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // users: %193, %178, %200, %176, %171
%171 = struct_element_addr %170 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._base // user: %173
%172 = load %112 : $*IndexingIterator<Array<Tensor<Float>>> // user: %173
store %172 to %171 : $*IndexingIterator<Array<Tensor<Float>>> // id: %173
%174 = integer_literal $Builtin.Int64, 0 // user: %175
%175 = struct $Int (%174 : $Builtin.Int64) // user: %177
%176 = struct_element_addr %170 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._count // user: %177
store %175 to %176 : $*Int // id: %177
%178 = load %170 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // users: %190, %179, %192
%179 = struct_extract %178 : $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._base // users: %188, %180
%180 = struct_extract %179 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %181
%181 = struct_extract %180 : $Array<Tensor<Float>>, #Array._buffer // user: %182
%182 = struct_extract %181 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %183
%183 = struct_extract %182 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %185, %184
strong_retain %183 : $Builtin.BridgeObject // id: %184
%185 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%183 : $Builtin.BridgeObject) // user: %186
%186 = struct $_ArrayBuffer<Tensor<Float>> (%185 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %187
%187 = struct $Array<Tensor<Float>> (%186 : $_ArrayBuffer<Tensor<Float>>) // user: %189
%188 = struct_extract %179 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._position // user: %189
%189 = struct $IndexingIterator<Array<Tensor<Float>>> (%187 : $Array<Tensor<Float>>, %188 : $Int) // user: %191
%190 = struct_extract %178 : $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._count // user: %191
%191 = struct $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> (%189 : $IndexingIterator<Array<Tensor<Float>>>, %190 : $Int)
store %178 to %74 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // id: %192
%193 = load %170 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // user: %194
%194 = struct_extract %193 : $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._base // user: %195
%195 = struct_extract %194 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %196
%196 = struct_extract %195 : $Array<Tensor<Float>>, #Array._buffer // user: %197
%197 = struct_extract %196 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %198
%198 = struct_extract %197 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %199
strong_release %198 : $Builtin.BridgeObject // id: %199
dealloc_stack %170 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // id: %200
dealloc_stack %112 : $*IndexingIterator<Array<Tensor<Float>>> // id: %201
%202 = tuple ()
%203 = load %110 : $*EnumeratedSequence<Array<Tensor<Float>>> // user: %204
%204 = struct_extract %203 : $EnumeratedSequence<Array<Tensor<Float>>>, #EnumeratedSequence._base // user: %205
%205 = struct_extract %204 : $Array<Tensor<Float>>, #Array._buffer // user: %206
%206 = struct_extract %205 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %207
%207 = struct_extract %206 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %208
strong_release %207 : $Builtin.BridgeObject // id: %208
dealloc_stack %110 : $*EnumeratedSequence<Array<Tensor<Float>>> // id: %209
dealloc_stack %75 : $*EnumeratedSequence<Array<Tensor<Float>>> // id: %210
br bb5(undef : $Tensor<Float>) // id: %211
// %212 // user: %432
bb5(%212 : $Tensor<Float>): // Preds: bb4 bb23
%213 = alloc_stack $Optional<(offset: Int, element: Tensor<Float>)> // users: %431, %425, %331, %318, %304, %295
%214 = begin_access [modify] [static] %74 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // users: %317, %278, %216
%215 = alloc_stack $Optional<Tensor<Float>> // users: %271, %617, %443, %430, %429, %274, %272, %265
%216 = struct_element_addr %214 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._base // users: %221, %218
%217 = metatype $@thick Int.Type // user: %258
%218 = struct_element_addr %216 : $*IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._position // users: %614, %606, %444, %220
%219 = alloc_stack $Int // users: %262, %261, %258, %220
copy_addr %218 to [initialization] %219 : $*Int // id: %220
%221 = struct_element_addr %216 : $*IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // users: %434, %223
%222 = alloc_stack $Int // users: %260, %259, %258, %255
%223 = load %221 : $*Array<Tensor<Float>> // user: %224
%224 = struct_extract %223 : $Array<Tensor<Float>>, #Array._buffer // user: %225
%225 = struct_extract %224 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %226
%226 = struct_extract %225 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %826, %823, %807, %803, %795, %250, %246, %239, %234
%227 = metatype $@thick Tensor<Float>.Type // users: %827, %816, %228
%228 = builtin "canBeClass"<Tensor<Float>>(%227 : $@thick Tensor<Float>.Type) : $Builtin.Int8 // users: %819, %810, %230
%229 = integer_literal $Builtin.Int8, 0 // user: %230
%230 = builtin "cmp_eq_Int8"(%228 : $Builtin.Int8, %229 : $Builtin.Int8) : $Builtin.Int1 // users: %788, %231
cond_br %230, bb6, bb96 // id: %231
bb6: // Preds: bb5
%232 = integer_literal $Builtin.Int1, 0 // user: %233
%233 = struct $Bool (%232 : $Builtin.Int1) // user: %235
strong_retain %226 : $Builtin.BridgeObject // id: %234
br bb7(%233 : $Bool) // id: %235
// %236 // user: %237
bb7(%236 : $Bool): // Preds: bb98 bb97 bb6
%237 = struct_extract %236 : $Bool, #Bool._value // user: %238
cond_br %237, bb8, bb87 // id: %238
bb8: // Preds: bb7
%239 = classify_bridge_object %226 : $Builtin.BridgeObject // users: %241, %240
%240 = tuple_extract %239 : $(Builtin.Int1, Builtin.Int1), 0 // user: %242
%241 = tuple_extract %239 : $(Builtin.Int1, Builtin.Int1), 1 // user: %242
%242 = builtin "or_Int1"(%240 : $Builtin.Int1, %241 : $Builtin.Int1) : $Builtin.Int1 // user: %244
%243 = integer_literal $Builtin.Int1, 0 // user: %244
%244 = builtin "int_expect_Int1"(%242 : $Builtin.Int1, %243 : $Builtin.Int1) : $Builtin.Int1 // user: %245
cond_br %244, bb9, bb87 // id: %245
bb9: // Preds: bb8
%246 = bridge_object_to_ref %226 : $Builtin.BridgeObject to $_NSArrayCore // user: %247
%247 = open_existential_ref %246 : $_NSArrayCore to $@opened("A27BD4CE-8704-11E8-97E8-98E0D9A1F2F1") _NSArrayCore // users: %249, %249, %248
%248 = objc_method %247 : $@opened("A27BD4CE-8704-11E8-97E8-98E0D9A1F2F1") _NSArrayCore, #_NSArrayCore.count!getter.1.foreign : <Self where Self : _NSArrayCore> (Self) -> () -> Int, $@convention(objc_method) <τ_0_0 where τ_0_0 : _NSArrayCore> (τ_0_0) -> Int // user: %249
%249 = apply %248<@opened("A27BD4CE-8704-11E8-97E8-98E0D9A1F2F1") _NSArrayCore>(%247) : $@convention(objc_method) <τ_0_0 where τ_0_0 : _NSArrayCore> (τ_0_0) -> Int // type-defs: %247; user: %251
strong_release %226 : $Builtin.BridgeObject // id: %250
br bb10(%249 : $Int) // id: %251
// %252 // user: %253
bb10(%252 : $Int): // Preds: bb91 bb9
br bb11(%252 : $Int) // id: %253
// %254 // user: %255
bb11(%254 : $Int): // Preds: bb10
store %254 to %222 : $*Int // id: %255
%256 = tuple ()
// function_ref protocol witness for static Equatable.== infix(_:_:) in conformance Int
%257 = function_ref @$SSis9EquatablessAAP2eeoiySbx_xtFZTW : $@convention(witness_method: Equatable) (@in_guaranteed Int, @in_guaranteed Int, @thick Int.Type) -> Bool // user: %258
%258 = apply %257(%219, %222, %217) : $@convention(witness_method: Equatable) (@in_guaranteed Int, @in_guaranteed Int, @thick Int.Type) -> Bool // user: %263
destroy_addr %222 : $*Int // id: %259
dealloc_stack %222 : $*Int // id: %260
destroy_addr %219 : $*Int // id: %261
dealloc_stack %219 : $*Int // id: %262
%263 = struct_extract %258 : $Bool, #Bool._value // user: %264
cond_br %263, bb12, bb30 // id: %264
bb12: // Preds: bb11
inject_enum_addr %215 : $*Optional<Tensor<Float>>, #Optional.none!enumelt // id: %265
br bb13 // id: %266
bb13: // Preds: bb54 bb12
%267 = tuple () // user: %268
br bb14(%267 : $()) // id: %268
bb14(%269 : $()): // Preds: bb13
%270 = tuple ()
switch_enum_addr %215 : $*Optional<Tensor<Float>>, case #Optional.some!enumelt.1: bb15, case #Optional.none!enumelt: bb29 // id: %271
bb15: // Preds: bb14
%272 = unchecked_take_enum_data_addr %215 : $*Optional<Tensor<Float>>, #Optional.some!enumelt.1 // user: %273
%273 = load %272 : $*Tensor<Float> // users: %312, %310, %284, %281
dealloc_stack %215 : $*Optional<Tensor<Float>> // id: %274
%275 = alloc_stack $(offset: Int, element: Tensor<Float>) // users: %305, %309, %277, %276
%276 = tuple_element_addr %275 : $*(offset: Int, element: Tensor<Float>), 1 // users: %299, %284
%277 = tuple_element_addr %275 : $*(offset: Int, element: Tensor<Float>), 0 // user: %280
%278 = struct_element_addr %214 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._count // users: %294, %286, %279
%279 = load %278 : $*Int // users: %298, %280
store %279 to %277 : $*Int // id: %280
%281 = struct_extract %273 : $Tensor<Float>, #Tensor.handle // users: %282, %283
strong_retain %281 : $TensorHandle<Float> // id: %282
%283 = struct $Tensor<Float> (%281 : $TensorHandle<Float>)
store %273 to %276 : $*Tensor<Float> // id: %284
%285 = integer_literal $Builtin.Int64, 1 // user: %289
%286 = struct_element_addr %278 : $*Int, #Int._value // user: %287
%287 = load %286 : $*Builtin.Int64 // user: %289
%288 = integer_literal $Builtin.Int1, -1 // user: %289
%289 = builtin "sadd_with_overflow_Int64"(%287 : $Builtin.Int64, %285 : $Builtin.Int64, %288 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %291, %290
%290 = tuple_extract %289 : $(Builtin.Int64, Builtin.Int1), 0 // user: %293
%291 = tuple_extract %289 : $(Builtin.Int64, Builtin.Int1), 1 // user: %292
cond_fail %291 : $Builtin.Int1 // id: %292
%293 = struct $Int (%290 : $Builtin.Int64) // user: %294
store %293 to %278 : $*Int // id: %294
%295 = init_enum_data_addr %213 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // users: %297, %296
%296 = tuple_element_addr %295 : $*(offset: Int, element: Tensor<Float>), 0 // user: %298
%297 = tuple_element_addr %295 : $*(offset: Int, element: Tensor<Float>), 1 // user: %303
store %279 to %296 : $*Int // id: %298
%299 = load %276 : $*Tensor<Float> // users: %300, %303
%300 = struct_extract %299 : $Tensor<Float>, #Tensor.handle // users: %301, %302
strong_retain %300 : $TensorHandle<Float> // id: %301
%302 = struct $Tensor<Float> (%300 : $TensorHandle<Float>)
store %299 to %297 : $*Tensor<Float> // id: %303
inject_enum_addr %213 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // id: %304
%305 = load %275 : $*(offset: Int, element: Tensor<Float>) // user: %306
%306 = tuple_extract %305 : $(offset: Int, element: Tensor<Float>), 1 // user: %307
%307 = struct_extract %306 : $Tensor<Float>, #Tensor.handle // user: %308
strong_release %307 : $TensorHandle<Float> // id: %308
dealloc_stack %275 : $*(offset: Int, element: Tensor<Float>) // id: %309
%310 = struct_extract %273 : $Tensor<Float>, #Tensor.handle // user: %311
strong_release %310 : $TensorHandle<Float> // id: %311
br bb16(%273 : $Tensor<Float>) // id: %312
// %313 // user: %406
bb16(%313 : $Tensor<Float>): // Preds: bb15 bb29
%314 = tuple () // user: %315
br bb17(%314 : $()) // id: %315
bb17(%316 : $()): // Preds: bb16
end_access %214 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // id: %317
%318 = load %213 : $*Optional<(offset: Int, element: Tensor<Float>)> // user: %319
switch_enum %318 : $Optional<(offset: Int, element: Tensor<Float>)>, case #Optional.some!enumelt.1: bb18, case #Optional.none!enumelt: bb27 // id: %319
// %320 // users: %328, %322, %321
bb18(%320 : $(offset: Int, element: Tensor<Float>)): // Preds: bb17
%321 = tuple_extract %320 : $(offset: Int, element: Tensor<Float>), 0 // user: %326
%322 = tuple_extract %320 : $(offset: Int, element: Tensor<Float>), 1 // users: %323, %326
%323 = struct_extract %322 : $Tensor<Float>, #Tensor.handle // users: %324, %325
strong_retain %323 : $TensorHandle<Float> // id: %324
%325 = struct $Tensor<Float> (%323 : $TensorHandle<Float>)
%326 = tuple (%321 : $Int, %322 : $Tensor<Float>) // user: %327
%327 = enum $Optional<(Int, Tensor<Float>)>, #Optional.some!enumelt.1, %326 : $(Int, Tensor<Float>) // user: %332
%328 = tuple_extract %320 : $(offset: Int, element: Tensor<Float>), 1 // user: %329
%329 = struct_extract %328 : $Tensor<Float>, #Tensor.handle // user: %330
strong_release %329 : $TensorHandle<Float> // id: %330
dealloc_stack %213 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %331
br bb19(%327 : $Optional<(Int, Tensor<Float>)>) // id: %332
// %333 // user: %334
bb19(%333 : $Optional<(Int, Tensor<Float>)>): // Preds: bb28 bb18
switch_enum %333 : $Optional<(Int, Tensor<Float>)>, case #Optional.some!enumelt.1: bb20, case #Optional.none!enumelt: bb25 // id: %334
// %335 // users: %403, %337, %336
bb20(%335 : $(Int, Tensor<Float>)): // Preds: bb19
%336 = tuple_extract %335 : $(Int, Tensor<Float>), 0 // users: %368, %341
%337 = tuple_extract %335 : $(Int, Tensor<Float>), 1 // users: %401, %338, %374, %372, %342
%338 = struct_extract %337 : $Tensor<Float>, #Tensor.handle // users: %339, %340
strong_retain %338 : $TensorHandle<Float> // id: %339
%340 = struct $Tensor<Float> (%338 : $TensorHandle<Float>)
debug_value %336 : $Int, let, name "i" // id: %341
debug_value %337 : $Tensor<Float>, let, name "x" // id: %342
%343 = integer_literal $Builtin.Word, 2 // users: %349, %344
%344 = builtin "zextOrBitCast_Word_Int64"(%343 : $Builtin.Word) : $Builtin.Int64 // users: %347, %345
%345 = struct $Int (%344 : $Builtin.Int64) // users: %409, %352
%346 = integer_literal $Builtin.Int64, 0 // user: %347
%347 = builtin "cmp_slt_Int64"(%346 : $Builtin.Int64, %344 : $Builtin.Int64) : $Builtin.Int1 // user: %348
cond_br %347, bb21, bb24 // id: %348
bb21: // Preds: bb20
%349 = alloc_ref [tail_elems $Any * %343 : $Builtin.Word] $_ContiguousArrayStorage<Any> // user: %352
%350 = metatype $@thin Array<Any>.Type // user: %352
// function_ref static Array._adoptStorage(_:count:)
%351 = function_ref @$SSa13_adoptStorage_5countSayxG_SpyxGts016_ContiguousArrayB0CyxGn_SitFZ : $@convention(method) <τ_0_0> (@owned _ContiguousArrayStorage<τ_0_0>, Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // user: %352
%352 = apply %351<Any>(%349, %345, %350) : $@convention(method) <τ_0_0> (@owned _ContiguousArrayStorage<τ_0_0>, Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // users: %354, %353
%353 = tuple_extract %352 : $(Array<Any>, UnsafeMutablePointer<Any>), 0 // user: %356
%354 = tuple_extract %352 : $(Array<Any>, UnsafeMutablePointer<Any>), 1 // user: %355
%355 = struct_extract %354 : $UnsafeMutablePointer<Any>, #UnsafeMutablePointer._rawValue // user: %356
br bb22(%353 : $Array<Any>, %355 : $Builtin.RawPointer) // id: %356
// %357 // user: %359
// %358 // user: %359
bb22(%357 : $Array<Any>, %358 : $Builtin.RawPointer): // Preds: bb24 bb21
%359 = tuple (%357 : $Array<Any>, %358 : $Builtin.RawPointer) // user: %360
br bb23(%359 : $(Array<Any>, Builtin.RawPointer)) // id: %360
// %361 // users: %365, %364, %362
bb23(%361 : $(Array<Any>, Builtin.RawPointer)): // Preds: bb22
%362 = tuple_extract %361 : $(Array<Any>, Builtin.RawPointer), 0 // users: %400, %397, %363
retain_value %362 : $Array<Any> // id: %363
%364 = tuple_extract %361 : $(Array<Any>, Builtin.RawPointer), 1 // user: %366
release_value %361 : $(Array<Any>, Builtin.RawPointer) // id: %365
%366 = pointer_to_address %364 : $Builtin.RawPointer to [strict] $*Any // users: %370, %367
%367 = init_existential_addr %366 : $*Any, $Int // user: %368
store %336 to %367 : $*Int // id: %368
%369 = integer_literal $Builtin.Word, 1 // user: %370
%370 = index_addr %366 : $*Any, %369 : $Builtin.Word // user: %371
%371 = init_existential_addr %370 : $*Any, $Tensor<Float> // user: %391
%372 = struct_extract %337 : $Tensor<Float>, #Tensor.handle // users: %379, %377, %373
strong_retain %372 : $TensorHandle<Float> // id: %373
%374 = struct_extract %337 : $Tensor<Float>, #Tensor.handle // users: %378, %377, %375
strong_retain %374 : $TensorHandle<Float> // id: %375
%376 = metatype $@thick Float.Type // user: %377
%377 = builtin "__tfop_Add,$in,$in,T"(%372 : $TensorHandle<Float>, %374 : $TensorHandle<Float>, %376 : $@thick Float.Type) : $TensorHandle<Float> // users: %390, %385, %380, %384, %383
strong_release %374 : $TensorHandle<Float> // id: %378
strong_release %372 : $TensorHandle<Float> // id: %379
strong_retain %377 : $TensorHandle<Float> // id: %380
%381 = alloc_stack $Tensor<Float> // users: %382, %386, %389
%382 = struct_element_addr %381 : $*Tensor<Float>, #Tensor.handle // user: %383
store %377 to %382 : $*TensorHandle<Float> // id: %383
%384 = struct $Tensor<Float> (%377 : $TensorHandle<Float>) // user: %391
strong_retain %377 : $TensorHandle<Float> // id: %385
%386 = load %381 : $*Tensor<Float> // user: %387
%387 = struct_extract %386 : $Tensor<Float>, #Tensor.handle // user: %388
strong_release %387 : $TensorHandle<Float> // id: %388
dealloc_stack %381 : $*Tensor<Float> // id: %389
strong_release %377 : $TensorHandle<Float> // id: %390
store %384 to %371 : $*Tensor<Float> // id: %391
// function_ref default argument 1 of print(_:separator:terminator:)
%392 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA0_ : $@convention(thin) () -> @owned String // user: %393
%393 = apply %392() : $@convention(thin) () -> @owned String // users: %399, %397
// function_ref default argument 2 of print(_:separator:terminator:)
%394 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA1_ : $@convention(thin) () -> @owned String // user: %395
%395 = apply %394() : $@convention(thin) () -> @owned String // users: %398, %397
// function_ref print(_:separator:terminator:)
%396 = function_ref @$Ss5print_9separator10terminatoryypd_S2StF : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> () // user: %397
%397 = apply %396(%362, %393, %395) : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> ()
release_value %395 : $String // id: %398
release_value %393 : $String // id: %399
release_value %362 : $Array<Any> // id: %400
%401 = struct_extract %337 : $Tensor<Float>, #Tensor.handle // user: %402
strong_release %401 : $TensorHandle<Float> // id: %402
%403 = tuple_extract %335 : $(Int, Tensor<Float>), 1 // user: %404
%404 = struct_extract %403 : $Tensor<Float>, #Tensor.handle // user: %405
strong_release %404 : $TensorHandle<Float> // id: %405
br bb5(%313 : $Tensor<Float>) // id: %406
bb24: // Preds: bb20
%407 = metatype $@thin Array<Any>.Type // user: %409
// function_ref static Array._allocateUninitialized(_:)
%408 = function_ref @$SSa22_allocateUninitializedySayxG_SpyxGtSiFZ : $@convention(method) <τ_0_0> (Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // user: %409
%409 = apply %408<Any>(%345, %407) : $@convention(method) <τ_0_0> (Int, @thin Array<τ_0_0>.Type) -> (@owned Array<τ_0_0>, UnsafeMutablePointer<τ_0_0>) // users: %411, %410
%410 = tuple_extract %409 : $(Array<Any>, UnsafeMutablePointer<Any>), 0 // user: %413
%411 = tuple_extract %409 : $(Array<Any>, UnsafeMutablePointer<Any>), 1 // user: %412
%412 = struct_extract %411 : $UnsafeMutablePointer<Any>, #UnsafeMutablePointer._rawValue // user: %413
br bb22(%410 : $Array<Any>, %412 : $Builtin.RawPointer) // id: %413
bb25: // Preds: bb19
br bb26 // id: %414
bb26: // Preds: bb25
%415 = load %74 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // user: %416
%416 = struct_extract %415 : $EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>>, #EnumeratedIterator._base // user: %417
%417 = struct_extract %416 : $IndexingIterator<Array<Tensor<Float>>>, #IndexingIterator._elements // user: %418
%418 = struct_extract %417 : $Array<Tensor<Float>>, #Array._buffer // user: %419
%419 = struct_extract %418 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %420
%420 = struct_extract %419 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %421
strong_release %420 : $Builtin.BridgeObject // id: %421
dealloc_stack %74 : $*EnumeratedIterator<IndexingIterator<Array<Tensor<Float>>>> // id: %422
%423 = tuple () // user: %424
br bb99(%423 : $()) // id: %424
bb27: // Preds: bb17
dealloc_stack %213 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %425
br bb28 // id: %426
bb28: // Preds: bb27
%427 = enum $Optional<(Int, Tensor<Float>)>, #Optional.none!enumelt // user: %428
br bb19(%427 : $Optional<(Int, Tensor<Float>)>) // id: %428
bb29: // Preds: bb14
destroy_addr %215 : $*Optional<Tensor<Float>> // id: %429
dealloc_stack %215 : $*Optional<Tensor<Float>> // id: %430
inject_enum_addr %213 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.none!enumelt // id: %431
br bb16(%212 : $Tensor<Float>) // id: %432
bb30: // Preds: bb11
%433 = alloc_stack $Array<Tensor<Float>> // users: %599, %442, %604, %445
%434 = load %221 : $*Array<Tensor<Float>> // users: %435, %442
%435 = struct_extract %434 : $Array<Tensor<Float>>, #Array._buffer // user: %436
%436 = struct_extract %435 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %437
%437 = struct_extract %436 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %439, %438
strong_retain %437 : $Builtin.BridgeObject // id: %438
%439 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%437 : $Builtin.BridgeObject) // user: %440
%440 = struct $_ArrayBuffer<Tensor<Float>> (%439 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %441
%441 = struct $Array<Tensor<Float>> (%440 : $_ArrayBuffer<Tensor<Float>>)
store %434 to %433 : $*Array<Tensor<Float>> // id: %442
%443 = init_enum_data_addr %215 : $*Optional<Tensor<Float>>, #Optional.some!enumelt.1 // users: %651, %592
%444 = load %218 : $*Int // users: %681, %621, %585, %549
%445 = load %433 : $*Array<Tensor<Float>> // users: %576, %473, %446
%446 = struct_extract %445 : $Array<Tensor<Float>>, #Array._buffer // user: %447
%447 = struct_extract %446 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %448
%448 = struct_extract %447 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %785, %782, %774, %462, %461, %456
%449 = metatype $@thick Tensor<Float>.Type // users: %786, %450
%450 = builtin "canBeClass"<Tensor<Float>>(%449 : $@thick Tensor<Float>.Type) : $Builtin.Int8 // users: %778, %452
%451 = integer_literal $Builtin.Int8, 0 // user: %452
%452 = builtin "cmp_eq_Int8"(%450 : $Builtin.Int8, %451 : $Builtin.Int8) : $Builtin.Int1 // user: %453
cond_br %452, bb31, bb84 // id: %453
bb31: // Preds: bb30
%454 = integer_literal $Builtin.Int1, 0 // user: %455
%455 = struct $Bool (%454 : $Builtin.Int1) // user: %457
strong_retain %448 : $Builtin.BridgeObject // id: %456
br bb32(%455 : $Bool) // id: %457
// %458 // user: %459
bb32(%458 : $Bool): // Preds: bb86 bb85 bb31
%459 = struct_extract %458 : $Bool, #Bool._value // user: %460
cond_br %459, bb33, bb83 // id: %460
bb33: // Preds: bb32
%461 = bridge_object_to_word %448 : $Builtin.BridgeObject to $Builtin.Word // user: %463
strong_release %448 : $Builtin.BridgeObject // id: %462
%463 = builtin "zextOrBitCast_Word_Int64"(%461 : $Builtin.Word) : $Builtin.Int64 // user: %465
%464 = integer_literal $Builtin.Int64, -4611686018427387901 // user: %465
%465 = builtin "and_Int64"(%463 : $Builtin.Int64, %464 : $Builtin.Int64) : $Builtin.Int64 // user: %467
%466 = integer_literal $Builtin.Int64, 0 // user: %467
%467 = builtin "cmp_eq_Int64"(%465 : $Builtin.Int64, %466 : $Builtin.Int64) : $Builtin.Int1 // user: %468
br bb34(%467 : $Builtin.Int1) // id: %468
// %469 // user: %470
bb34(%469 : $Builtin.Int1): // Preds: bb83 bb33
%470 = struct $Bool (%469 : $Builtin.Int1) // user: %471
br bb35(%470 : $Bool) // id: %471
// %472 // users: %754, %713, %580, %520, %512
bb35(%472 : $Bool): // Preds: bb34
%473 = struct_extract %445 : $Array<Tensor<Float>>, #Array._buffer // users: %477, %474
%474 = struct_extract %473 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %475
%475 = struct_extract %474 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %575, %476
strong_retain %475 : $Builtin.BridgeObject // id: %476
%477 = struct_extract %473 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %478
%478 = struct_extract %477 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %771, %768, %759, %746, %741, %728, %725, %718, %694, %560, %559, %534, %517, %506, %501
%479 = string_literal utf8 "inout rules were violated: the array was overwritten" // user: %481
%480 = integer_literal $Builtin.Word, 52 // user: %483
%481 = builtin "ptrtoint_Word"(%479 : $Builtin.RawPointer) : $Builtin.Word // user: %483
%482 = integer_literal $Builtin.Int8, 2 // users: %707, %555, %544, %540, %487, %483
%483 = struct $StaticString (%481 : $Builtin.Word, %480 : $Builtin.Word, %482 : $Builtin.Int8) // user: %711
%484 = string_literal utf8 "/Library/Caches/swift-build/swift/stdlib/public/core/ArrayBuffer.swift" // user: %486
%485 = integer_literal $Builtin.Word, 70 // user: %487
%486 = builtin "ptrtoint_Word"(%484 : $Builtin.RawPointer) : $Builtin.Word // user: %487
%487 = struct $StaticString (%486 : $Builtin.Word, %485 : $Builtin.Word, %482 : $Builtin.Int8) // user: %711
%488 = integer_literal $Builtin.Int64, 369 // user: %489
%489 = struct $UInt (%488 : $Builtin.Int64) // user: %711
%490 = builtin "assert_configuration"() : $Builtin.Int32 // users: %732, %678, %492
%491 = integer_literal $Builtin.Int32, 0 // user: %492
%492 = builtin "cmp_eq_Int32"(%490 : $Builtin.Int32, %491 : $Builtin.Int32) : $Builtin.Int1 // users: %547, %493
cond_br %492, bb36, bb73 // id: %493
bb36: // Preds: bb35
%494 = metatype $@thick Tensor<Float>.Type // users: %729, %495
%495 = builtin "canBeClass"<Tensor<Float>>(%494 : $@thick Tensor<Float>.Type) : $Builtin.Int8 // users: %721, %497
%496 = integer_literal $Builtin.Int8, 0 // user: %497
%497 = builtin "cmp_eq_Int8"(%495 : $Builtin.Int8, %496 : $Builtin.Int8) : $Builtin.Int1 // user: %498
cond_br %497, bb37, bb70 // id: %498
bb37: // Preds: bb36
%499 = integer_literal $Builtin.Int1, 0 // user: %500
%500 = struct $Bool (%499 : $Builtin.Int1) // user: %502
strong_retain %478 : $Builtin.BridgeObject // id: %501
br bb38(%500 : $Bool) // id: %502
// %503 // user: %504
bb38(%503 : $Bool): // Preds: bb72 bb71 bb37
%504 = struct_extract %503 : $Bool, #Bool._value // user: %505
cond_br %504, bb39, bb68 // id: %505
bb39: // Preds: bb38
%506 = bridge_object_to_word %478 : $Builtin.BridgeObject to $Builtin.Word // user: %507
%507 = builtin "zextOrBitCast_Word_Int64"(%506 : $Builtin.Word) : $Builtin.Int64 // user: %509
%508 = integer_literal $Builtin.Int64, -4611686018427387901 // user: %509
%509 = builtin "and_Int64"(%507 : $Builtin.Int64, %508 : $Builtin.Int64) : $Builtin.Int64 // user: %511
%510 = integer_literal $Builtin.Int64, 0 // user: %511
%511 = builtin "cmp_eq_Int64"(%509 : $Builtin.Int64, %510 : $Builtin.Int64) : $Builtin.Int1 // user: %513
%512 = struct_extract %472 : $Bool, #Bool._value // user: %513
%513 = builtin "cmp_eq_Int1"(%511 : $Builtin.Int1, %512 : $Builtin.Int1) : $Builtin.Int1 // user: %515
%514 = integer_literal $Builtin.Int1, -1 // user: %515
%515 = builtin "int_expect_Int1"(%513 : $Builtin.Int1, %514 : $Builtin.Int1) : $Builtin.Int1 // user: %516
cond_br %515, bb40, bb67 // id: %516
bb40: // Preds: bb39
strong_release %478 : $Builtin.BridgeObject // id: %517
br bb41 // id: %518
bb41: // Preds: bb78 bb73 bb69 bb40
%519 = integer_literal $Builtin.Int1, -1 // users: %699, %691, %570, %521
%520 = struct_extract %472 : $Bool, #Bool._value // user: %521
%521 = builtin "int_expect_Int1"(%520 : $Builtin.Int1, %519 : $Builtin.Int1) : $Builtin.Int1 // user: %522
cond_br %521, bb42, bb50 // id: %522
bb42: // Preds: bb41
%523 = metatype $@thick Tensor<Float>.Type // users: %702, %524
%524 = builtin "canBeClass"<Tensor<Float>>(%523 : $@thick Tensor<Float>.Type) : $Builtin.Int8 // users: %697, %526
%525 = integer_literal $Builtin.Int8, 0 // user: %526
%526 = builtin "cmp_eq_Int8"(%524 : $Builtin.Int8, %525 : $Builtin.Int8) : $Builtin.Int1 // user: %527
cond_br %526, bb43, bb64 // id: %527
bb43: // Preds: bb42
%528 = integer_literal $Builtin.Int1, 0 // user: %529
%529 = struct $Bool (%528 : $Builtin.Int1) // user: %530
br bb44(%529 : $Bool) // id: %530
// %531 // user: %532
bb44(%531 : $Bool): // Preds: bb66 bb65 bb43
%532 = struct_extract %531 : $Bool, #Bool._value // user: %533
cond_br %532, bb45, bb63 // id: %533
bb45: // Preds: bb44
%534 = bridge_object_to_ref %478 : $Builtin.BridgeObject to $_ContiguousArrayStorageBase // user: %535
br bb46(%534 : $_ContiguousArrayStorageBase) // id: %535
// %536 // users: %684, %563
bb46(%536 : $_ContiguousArrayStorageBase): // Preds: bb63 bb45
%537 = string_literal utf8 "Index out of range" // user: %539
%538 = integer_literal $Builtin.Word, 18 // user: %540
%539 = builtin "ptrtoint_Word"(%537 : $Builtin.RawPointer) : $Builtin.Word // user: %540
%540 = struct $StaticString (%539 : $Builtin.Word, %538 : $Builtin.Word, %482 : $Builtin.Int8) // user: %561
%541 = string_literal utf8 "/Library/Caches/swift-build/swift/stdlib/public/core/ContiguousArrayBuffer.swift" // user: %543
%542 = integer_literal $Builtin.Word, 80 // user: %544
%543 = builtin "ptrtoint_Word"(%541 : $Builtin.RawPointer) : $Builtin.Word // user: %544
%544 = struct $StaticString (%543 : $Builtin.Word, %542 : $Builtin.Word, %482 : $Builtin.Int8) // user: %561
%545 = integer_literal $Builtin.Int64, 380 // user: %546
%546 = struct $UInt (%545 : $Builtin.Int64) // user: %561
cond_br %492, bb47, bb61 // id: %547
bb47: // Preds: bb46
%548 = integer_literal $Builtin.Int64, 0 // user: %550
%549 = struct_extract %444 : $Int, #Int._value // users: %569, %550
%550 = builtin "cmp_slt_Int64"(%549 : $Builtin.Int64, %548 : $Builtin.Int64) : $Builtin.Int1 // user: %551
cond_br %550, bb48, bb49 // id: %551
bb48: // Preds: bb49 bb47
%552 = string_literal utf8 "Fatal error" // user: %554
%553 = integer_literal $Builtin.Word, 11 // user: %555
%554 = builtin "ptrtoint_Word"(%552 : $Builtin.RawPointer) : $Builtin.Word // user: %555
%555 = struct $StaticString (%554 : $Builtin.Word, %553 : $Builtin.Word, %482 : $Builtin.Int8) // user: %561
%556 = integer_literal $Builtin.Int32, 1 // user: %557
%557 = struct $UInt32 (%556 : $Builtin.Int32) // user: %561
// function_ref _fatalErrorMessage(_:_:file:line:flags:)
%558 = function_ref @$Ss18_fatalErrorMessage__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never // user: %561
strong_retain %478 : $Builtin.BridgeObject // id: %559
strong_retain %478 : $Builtin.BridgeObject // id: %560
%561 = apply %558(%555, %540, %544, %546, %557) : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never
unreachable // id: %562
bb49: // Preds: bb47
%563 = ref_element_addr %536 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // user: %564
%564 = struct_element_addr %563 : $*_ArrayBody, #_ArrayBody._storage // user: %565
%565 = struct_element_addr %564 : $*_SwiftArrayBodyStorage, #_SwiftArrayBodyStorage.count // user: %566
%566 = struct_element_addr %565 : $*Int, #Int._value // user: %567
%567 = load %566 : $*Builtin.Int64 // user: %568
%568 = builtin "assumeNonNegative_Int64"(%567 : $Builtin.Int64) : $Builtin.Int64 // user: %569
%569 = builtin "cmp_slt_Int64"(%549 : $Builtin.Int64, %568 : $Builtin.Int64) : $Builtin.Int1 // user: %570
%570 = builtin "int_expect_Int1"(%569 : $Builtin.Int1, %519 : $Builtin.Int1) : $Builtin.Int1 // user: %571
cond_br %570, bb50, bb48 // id: %571
bb50: // Preds: bb62 bb61 bb49 bb41
%572 = tuple () // user: %573
br bb51(%572 : $()) // id: %573
bb51(%574 : $()): // Preds: bb50
strong_release %475 : $Builtin.BridgeObject // id: %575
%576 = struct_extract %445 : $Array<Tensor<Float>>, #Array._buffer // users: %621, %577
%577 = struct_extract %576 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %578
%578 = struct_extract %577 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // users: %655, %620, %583
%579 = integer_literal $Builtin.Int1, -1 // users: %674, %644, %581
%580 = struct_extract %472 : $Bool, #Bool._value // user: %581
%581 = builtin "int_expect_Int1"(%580 : $Builtin.Int1, %579 : $Builtin.Int1) : $Builtin.Int1 // user: %582
cond_br %581, bb52, bb55 // id: %582
bb52: // Preds: bb51
%583 = unchecked_ref_cast %578 : $Builtin.BridgeObject to $_ContiguousArrayStorageBase // user: %584
%584 = ref_tail_addr %583 : $_ContiguousArrayStorageBase, $Tensor<Float> // user: %587
%585 = struct_extract %444 : $Int, #Int._value // user: %586
%586 = builtin "truncOrBitCast_Int64_Word"(%585 : $Builtin.Int64) : $Builtin.Word // user: %587
%587 = index_addr %584 : $*Tensor<Float>, %586 : $Builtin.Word // user: %588
%588 = load %587 : $*Tensor<Float> // users: %589, %592
%589 = struct_extract %588 : $Tensor<Float>, #Tensor.handle // users: %590, %591
strong_retain %589 : $TensorHandle<Float> // id: %590
%591 = struct $Tensor<Float> (%589 : $TensorHandle<Float>)
store %588 to %443 : $*Tensor<Float> // id: %592
br bb53 // id: %593
bb53: // Preds: bb57 bb52
%594 = tuple () // user: %595
br bb54(%594 : $()) // id: %595
bb54(%596 : $()): // Preds: bb53
%597 = tuple ()
%598 = tuple ()
%599 = load %433 : $*Array<Tensor<Float>> // user: %600
%600 = struct_extract %599 : $Array<Tensor<Float>>, #Array._buffer // user: %601
%601 = struct_extract %600 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %602
%602 = struct_extract %601 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %603
strong_release %602 : $Builtin.BridgeObject // id: %603
dealloc_stack %433 : $*Array<Tensor<Float>> // id: %604
%605 = integer_literal $Builtin.Int64, 1 // user: %609
%606 = struct_element_addr %218 : $*Int, #Int._value // user: %607
%607 = load %606 : $*Builtin.Int64 // user: %609
%608 = integer_literal $Builtin.Int1, -1 // user: %609
%609 = builtin "sadd_with_overflow_Int64"(%607 : $Builtin.Int64, %605 : $Builtin.Int64, %608 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %611, %610
%610 = tuple_extract %609 : $(Builtin.Int64, Builtin.Int1), 0 // user: %613
%611 = tuple_extract %609 : $(Builtin.Int64, Builtin.Int1), 1 // user: %612
cond_fail %611 : $Builtin.Int1 // id: %612
%613 = struct $Int (%610 : $Builtin.Int64) // user: %614
store %613 to %218 : $*Int // id: %614
%615 = tuple ()
%616 = tuple ()
inject_enum_addr %215 : $*Optional<Tensor<Float>>, #Optional.some!enumelt.1 // id: %617
br bb13 // id: %618
bb55: // Preds: bb51
// function_ref _ArrayBuffer._getElementSlowPath(_:)
%619 = function_ref @$Ss12_ArrayBufferV19_getElementSlowPathyyXlSiF : $@convention(method) <τ_0_0> (Int, @guaranteed _ArrayBuffer<τ_0_0>) -> @owned AnyObject // user: %621
strong_retain %578 : $Builtin.BridgeObject // id: %620
%621 = apply %619<Tensor<Float>>(%444, %576) : $@convention(method) <τ_0_0> (Int, @guaranteed _ArrayBuffer<τ_0_0>) -> @owned AnyObject // user: %623
%622 = alloc_stack $AnyObject // users: %654, %652, %646, %623
store %621 to %622 : $*AnyObject // id: %623
%624 = string_literal utf8 "Can't unsafeBitCast between types of different sizes" // user: %626
%625 = integer_literal $Builtin.Word, 52 // user: %628
%626 = builtin "ptrtoint_Word"(%624 : $Builtin.RawPointer) : $Builtin.Word // user: %628
%627 = integer_literal $Builtin.Int8, 2 // users: %660, %632, %628
%628 = struct $StaticString (%626 : $Builtin.Word, %625 : $Builtin.Word, %627 : $Builtin.Int8) // user: %664
%629 = string_literal utf8 "/Library/Caches/swift-build/swift/stdlib/public/core/Builtin.swift" // user: %631
%630 = integer_literal $Builtin.Word, 66 // user: %632
%631 = builtin "ptrtoint_Word"(%629 : $Builtin.RawPointer) : $Builtin.Word // user: %632
%632 = struct $StaticString (%631 : $Builtin.Word, %630 : $Builtin.Word, %627 : $Builtin.Int8) // user: %664
%633 = integer_literal $Builtin.Int64, 84 // user: %634
%634 = struct $UInt (%633 : $Builtin.Int64) // user: %664
%635 = builtin "assert_configuration"() : $Builtin.Int32 // users: %667, %637
%636 = integer_literal $Builtin.Int32, 0 // user: %637
%637 = builtin "cmp_eq_Int32"(%635 : $Builtin.Int32, %636 : $Builtin.Int32) : $Builtin.Int1 // user: %638
cond_br %637, bb56, bb59 // id: %638
bb56: // Preds: bb55
%639 = metatype $@thick AnyObject.Protocol // user: %640
%640 = builtin "sizeof"<AnyObject>(%639 : $@thick AnyObject.Protocol) : $Builtin.Word // user: %643
%641 = metatype $@thick Tensor<Float>.Type // user: %642
%642 = builtin "sizeof"<Tensor<Float>>(%641 : $@thick Tensor<Float>.Type) : $Builtin.Word // user: %643
%643 = builtin "cmp_eq_Word"(%640 : $Builtin.Word, %642 : $Builtin.Word) : $Builtin.Int1 // user: %644
%644 = builtin "int_expect_Int1"(%643 : $Builtin.Int1, %579 : $Builtin.Int1) : $Builtin.Int1 // user: %645
cond_br %644, bb57, bb58 // id: %645
bb57: // Preds: bb60 bb59 bb56
%646 = unchecked_addr_cast %622 : $*AnyObject to $*Tensor<Float> // user: %647
%647 = load %646 : $*Tensor<Float> // users: %648, %651
%648 = struct_extract %647 : $Tensor<Float>, #Tensor.handle // users: %649, %650
strong_retain %648 : $TensorHandle<Float> // id: %649
%650 = struct $Tensor<Float> (%648 : $TensorHandle<Float>)
store %647 to %443 : $*Tensor<Float> // id: %651
%652 = load %622 : $*AnyObject // user: %653
strong_release %652 : $AnyObject // id: %653
dealloc_stack %622 : $*AnyObject // id: %654
strong_release %578 : $Builtin.BridgeObject // id: %655
br bb53 // id: %656
bb58: // Preds: bb56
%657 = string_literal utf8 "Fatal error" // user: %659
%658 = integer_literal $Builtin.Word, 11 // user: %660
%659 = builtin "ptrtoint_Word"(%657 : $Builtin.RawPointer) : $Builtin.Word // user: %660
%660 = struct $StaticString (%659 : $Builtin.Word, %658 : $Builtin.Word, %627 : $Builtin.Int8) // user: %664
%661 = integer_literal $Builtin.Int32, 1 // user: %662
%662 = struct $UInt32 (%661 : $Builtin.Int32) // user: %664
// function_ref _fatalErrorMessage(_:_:file:line:flags:)
%663 = function_ref @$Ss18_fatalErrorMessage__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never // user: %664
%664 = apply %663(%660, %628, %632, %634, %662) : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never
unreachable // id: %665
bb59: // Preds: bb55
%666 = integer_literal $Builtin.Int32, 1 // user: %667
%667 = builtin "cmp_eq_Int32"(%635 : $Builtin.Int32, %666 : $Builtin.Int32) : $Builtin.Int1 // user: %668
cond_br %667, bb60, bb57 // id: %668
bb60: // Preds: bb59
%669 = metatype $@thick AnyObject.Protocol // user: %670
%670 = builtin "sizeof"<AnyObject>(%669 : $@thick AnyObject.Protocol) : $Builtin.Word // user: %673
%671 = metatype $@thick Tensor<Float>.Type // user: %672
%672 = builtin "sizeof"<Tensor<Float>>(%671 : $@thick Tensor<Float>.Type) : $Builtin.Word // user: %673
%673 = builtin "cmp_eq_Word"(%670 : $Builtin.Word, %672 : $Builtin.Word) : $Builtin.Int1 // user: %674
%674 = builtin "xor_Int1"(%673 : $Builtin.Int1, %579 : $Builtin.Int1) : $Builtin.Int1 // user: %675
cond_fail %674 : $Builtin.Int1 // id: %675
br bb57 // id: %676
bb61: // Preds: bb46
%677 = integer_literal $Builtin.Int32, 1 // user: %678
%678 = builtin "cmp_eq_Int32"(%490 : $Builtin.Int32, %677 : $Builtin.Int32) : $Builtin.Int1 // user: %679
cond_br %678, bb62, bb50 // id: %679
bb62: // Preds: bb61
%680 = integer_literal $Builtin.Int64, 0 // user: %682
%681 = struct_extract %444 : $Int, #Int._value // users: %690, %682
%682 = builtin "cmp_slt_Int64"(%681 : $Builtin.Int64, %680 : $Builtin.Int64) : $Builtin.Int1 // user: %683
cond_fail %682 : $Builtin.Int1 // id: %683
%684 = ref_element_addr %536 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // user: %685
%685 = struct_element_addr %684 : $*_ArrayBody, #_ArrayBody._storage // user: %686
%686 = struct_element_addr %685 : $*_SwiftArrayBodyStorage, #_SwiftArrayBodyStorage.count // user: %687
%687 = struct_element_addr %686 : $*Int, #Int._value // user: %688
%688 = load %687 : $*Builtin.Int64 // user: %689
%689 = builtin "assumeNonNegative_Int64"(%688 : $Builtin.Int64) : $Builtin.Int64 // user: %690
%690 = builtin "cmp_slt_Int64"(%681 : $Builtin.Int64, %689 : $Builtin.Int64) : $Builtin.Int1 // user: %691
%691 = builtin "xor_Int1"(%690 : $Builtin.Int1, %519 : $Builtin.Int1) : $Builtin.Int1 // user: %692
cond_fail %691 : $Builtin.Int1 // id: %692
br bb50 // id: %693
bb63: // Preds: bb44
%694 = unchecked_ref_cast %478 : $Builtin.BridgeObject to $_ContiguousArrayStorageBase // user: %695
br bb46(%694 : $_ContiguousArrayStorageBase) // id: %695
bb64: // Preds: bb42
%696 = integer_literal $Builtin.Int8, 1 // user: %697
%697 = builtin "cmp_eq_Int8"(%524 : $Builtin.Int8, %696 : $Builtin.Int8) : $Builtin.Int1 // user: %698
cond_br %697, bb65, bb66 // id: %698
bb65: // Preds: bb64
%699 = struct $Bool (%519 : $Builtin.Int1) // user: %700
br bb44(%699 : $Bool) // id: %700
bb66: // Preds: bb64
// function_ref _swift_isClassOrObjCExistentialType
%701 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %702
%702 = apply %701<Tensor<Float>>(%523) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %703
br bb44(%702 : $Bool) // id: %703
bb67: // Preds: bb68 bb39
%704 = string_literal utf8 "Fatal error" // user: %706
%705 = integer_literal $Builtin.Word, 11 // user: %707
%706 = builtin "ptrtoint_Word"(%704 : $Builtin.RawPointer) : $Builtin.Word // user: %707
%707 = struct $StaticString (%706 : $Builtin.Word, %705 : $Builtin.Word, %482 : $Builtin.Int8) // user: %711
%708 = integer_literal $Builtin.Int32, 1 // user: %709
%709 = struct $UInt32 (%708 : $Builtin.Int32) // user: %711
// function_ref _fatalErrorMessage(_:_:file:line:flags:)
%710 = function_ref @$Ss18_fatalErrorMessage__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never // user: %711
%711 = apply %710(%707, %483, %487, %489, %709) : $@convention(thin) (StaticString, StaticString, StaticString, UInt, UInt32) -> Never
unreachable // id: %712
bb68: // Preds: bb38
%713 = struct_extract %472 : $Bool, #Bool._value // user: %715
%714 = integer_literal $Builtin.Int1, 0 // users: %716, %715
%715 = builtin "cmp_eq_Int1"(%713 : $Builtin.Int1, %714 : $Builtin.Int1) : $Builtin.Int1 // user: %716
%716 = builtin "int_expect_Int1"(%715 : $Builtin.Int1, %714 : $Builtin.Int1) : $Builtin.Int1 // user: %717
cond_br %716, bb67, bb69 // id: %717
bb69: // Preds: bb68
strong_release %478 : $Builtin.BridgeObject // id: %718
br bb41 // id: %719
bb70: // Preds: bb36
%720 = integer_literal $Builtin.Int8, 1 // user: %721
%721 = builtin "cmp_eq_Int8"(%495 : $Builtin.Int8, %720 : $Builtin.Int8) : $Builtin.Int1 // user: %722
cond_br %721, bb71, bb72 // id: %722
bb71: // Preds: bb70
%723 = integer_literal $Builtin.Int1, -1 // user: %724
%724 = struct $Bool (%723 : $Builtin.Int1) // user: %726
strong_retain %478 : $Builtin.BridgeObject // id: %725
br bb38(%724 : $Bool) // id: %726
bb72: // Preds: bb70
// function_ref _swift_isClassOrObjCExistentialType
%727 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %729
strong_retain %478 : $Builtin.BridgeObject // id: %728
%729 = apply %727<Tensor<Float>>(%494) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %730
br bb38(%729 : $Bool) // id: %730
bb73: // Preds: bb35
%731 = integer_literal $Builtin.Int32, 1 // user: %732
%732 = builtin "cmp_eq_Int32"(%490 : $Builtin.Int32, %731 : $Builtin.Int32) : $Builtin.Int1 // user: %733
cond_br %732, bb74, bb41 // id: %733
bb74: // Preds: bb73
%734 = metatype $@thick Tensor<Float>.Type // users: %772, %735
%735 = builtin "canBeClass"<Tensor<Float>>(%734 : $@thick Tensor<Float>.Type) : $Builtin.Int8 // users: %764, %737
%736 = integer_literal $Builtin.Int8, 0 // user: %737
%737 = builtin "cmp_eq_Int8"(%735 : $Builtin.Int8, %736 : $Builtin.Int8) : $Builtin.Int1 // user: %738
cond_br %737, bb75, bb80 // id: %738
bb75: // Preds: bb74
%739 = integer_literal $Builtin.Int1, 0 // user: %740
%740 = struct $Bool (%739 : $Builtin.Int1) // user: %742
strong_retain %478 : $Builtin.BridgeObject // id: %741
br bb76(%740 : $Bool) // id: %742
// %743 // user: %744
bb76(%743 : $Bool): // Preds: bb82 bb81 bb75
%744 = struct_extract %743 : $Bool, #Bool._value // user: %745
cond_br %744, bb77, bb79 // id: %745
bb77: // Preds: bb76
%746 = bridge_object_to_word %478 : $Builtin.BridgeObject to $Builtin.Word // user: %747
%747 = builtin "zextOrBitCast_Word_Int64"(%746 : $Builtin.Word) : $Builtin.Int64 // user: %749
%748 = integer_literal $Builtin.Int64, -4611686018427387901 // user: %749
%749 = builtin "and_Int64"(%747 : $Builtin.Int64, %748 : $Builtin.Int64) : $Builtin.Int64 // user: %751
%750 = integer_literal $Builtin.Int64, 0 // user: %751
%751 = builtin "cmp_eq_Int64"(%749 : $Builtin.Int64, %750 : $Builtin.Int64) : $Builtin.Int1 // user: %752
br bb78(%751 : $Builtin.Int1) // id: %752
// %753 // user: %755
bb78(%753 : $Builtin.Int1): // Preds: bb79 bb77
%754 = struct_extract %472 : $Bool, #Bool._value // user: %755
%755 = builtin "cmp_eq_Int1"(%753 : $Builtin.Int1, %754 : $Builtin.Int1) : $Builtin.Int1 // user: %757
%756 = integer_literal $Builtin.Int1, -1 // user: %757
%757 = builtin "xor_Int1"(%755 : $Builtin.Int1, %756 : $Builtin.Int1) : $Builtin.Int1 // user: %758
cond_fail %757 : $Builtin.Int1 // id: %758
strong_release %478 : $Builtin.BridgeObject // id: %759
br bb41 // id: %760
bb79: // Preds: bb76
%761 = integer_literal $Builtin.Int1, -1 // user: %762
br bb78(%761 : $Builtin.Int1) // id: %762
bb80: // Preds: bb74
%763 = integer_literal $Builtin.Int8, 1 // user: %764
%764 = builtin "cmp_eq_Int8"(%735 : $Builtin.Int8, %763 : $Builtin.Int8) : $Builtin.Int1 // user: %765
cond_br %764, bb81, bb82 // id: %765
bb81: // Preds: bb80
%766 = integer_literal $Builtin.Int1, -1 // user: %767
%767 = struct $Bool (%766 : $Builtin.Int1) // user: %769
strong_retain %478 : $Builtin.BridgeObject // id: %768
br bb76(%767 : $Bool) // id: %769
bb82: // Preds: bb80
// function_ref _swift_isClassOrObjCExistentialType
%770 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %772
strong_retain %478 : $Builtin.BridgeObject // id: %771
%772 = apply %770<Tensor<Float>>(%734) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %773
br bb76(%772 : $Bool) // id: %773
bb83: // Preds: bb32
strong_release %448 : $Builtin.BridgeObject // id: %774
%775 = integer_literal $Builtin.Int1, -1 // user: %776
br bb34(%775 : $Builtin.Int1) // id: %776
bb84: // Preds: bb30
%777 = integer_literal $Builtin.Int8, 1 // user: %778
%778 = builtin "cmp_eq_Int8"(%450 : $Builtin.Int8, %777 : $Builtin.Int8) : $Builtin.Int1 // user: %779
cond_br %778, bb85, bb86 // id: %779
bb85: // Preds: bb84
%780 = integer_literal $Builtin.Int1, -1 // user: %781
%781 = struct $Bool (%780 : $Builtin.Int1) // user: %783
strong_retain %448 : $Builtin.BridgeObject // id: %782
br bb32(%781 : $Bool) // id: %783
bb86: // Preds: bb84
// function_ref _swift_isClassOrObjCExistentialType
%784 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %786
strong_retain %448 : $Builtin.BridgeObject // id: %785
%786 = apply %784<Tensor<Float>>(%449) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %787
br bb32(%786 : $Bool) // id: %787
bb87: // Preds: bb8 bb7
cond_br %230, bb88, bb93 // id: %788
bb88: // Preds: bb87
%789 = integer_literal $Builtin.Int1, 0 // user: %790
%790 = struct $Bool (%789 : $Builtin.Int1) // user: %791
br bb89(%790 : $Bool) // id: %791
// %792 // user: %793
bb89(%792 : $Bool): // Preds: bb95 bb94 bb88
%793 = struct_extract %792 : $Bool, #Bool._value // user: %794
cond_br %793, bb90, bb92 // id: %794
bb90: // Preds: bb89
%795 = bridge_object_to_ref %226 : $Builtin.BridgeObject to $_ContiguousArrayStorageBase // user: %796
br bb91(%795 : $_ContiguousArrayStorageBase) // id: %796
// %797 // user: %798
bb91(%797 : $_ContiguousArrayStorageBase): // Preds: bb92 bb90
%798 = ref_element_addr %797 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // user: %799
%799 = struct_element_addr %798 : $*_ArrayBody, #_ArrayBody._storage // user: %800
%800 = struct_element_addr %799 : $*_SwiftArrayBodyStorage, #_SwiftArrayBodyStorage.count // user: %801
%801 = struct_element_addr %800 : $*Int, #Int._value // user: %802
%802 = load %801 : $*Builtin.Int64 // user: %804
strong_release %226 : $Builtin.BridgeObject // id: %803
%804 = builtin "assumeNonNegative_Int64"(%802 : $Builtin.Int64) : $Builtin.Int64 // user: %805
%805 = struct $Int (%804 : $Builtin.Int64) // user: %806
br bb10(%805 : $Int) // id: %806
bb92: // Preds: bb89
%807 = unchecked_ref_cast %226 : $Builtin.BridgeObject to $_ContiguousArrayStorageBase // user: %808
br bb91(%807 : $_ContiguousArrayStorageBase) // id: %808
bb93: // Preds: bb87
%809 = integer_literal $Builtin.Int8, 1 // user: %810
%810 = builtin "cmp_eq_Int8"(%228 : $Builtin.Int8, %809 : $Builtin.Int8) : $Builtin.Int1 // user: %811
cond_br %810, bb94, bb95 // id: %811
bb94: // Preds: bb93
%812 = integer_literal $Builtin.Int1, -1 // user: %813
%813 = struct $Bool (%812 : $Builtin.Int1) // user: %814
br bb89(%813 : $Bool) // id: %814
bb95: // Preds: bb93
// function_ref _swift_isClassOrObjCExistentialType
%815 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %816
%816 = apply %815<Tensor<Float>>(%227) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %817
br bb89(%816 : $Bool) // id: %817
bb96: // Preds: bb5
%818 = integer_literal $Builtin.Int8, 1 // user: %819
%819 = builtin "cmp_eq_Int8"(%228 : $Builtin.Int8, %818 : $Builtin.Int8) : $Builtin.Int1 // user: %820
cond_br %819, bb97, bb98 // id: %820
bb97: // Preds: bb96
%821 = integer_literal $Builtin.Int1, -1 // user: %822
%822 = struct $Bool (%821 : $Builtin.Int1) // user: %824
strong_retain %226 : $Builtin.BridgeObject // id: %823
br bb7(%822 : $Bool) // id: %824
bb98: // Preds: bb96
// function_ref _swift_isClassOrObjCExistentialType
%825 = function_ref @_swift_isClassOrObjCExistentialType : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %827
strong_retain %226 : $Builtin.BridgeObject // id: %826
%827 = apply %825<Tensor<Float>>(%227) : $@convention(thin) <τ_0_0> (@thick τ_0_0.Type) -> Bool // user: %828
br bb7(%827 : $Bool) // id: %828
bb99(%829 : $()): // Preds: bb26
%830 = struct_extract %28 : $Array<Tensor<Float>>, #Array._buffer // user: %831
%831 = struct_extract %830 : $_ArrayBuffer<Tensor<Float>>, #_ArrayBuffer._storage // user: %832
%832 = struct_extract %831 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>, #_BridgeStorage.rawValue // user: %833
strong_release %832 : $Builtin.BridgeObject // id: %833
%834 = integer_literal $Builtin.Int32, 0 // user: %835
%835 = struct $Int32 (%834 : $Builtin.Int32) // user: %836
return %835 : $Int32 // id: %836
} // end sil function 'main'
----
---- INPUT FUNCTION main ----------
// main
sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
%2 = integer_literal $Builtin.Word, 2 // users: %71, %5
%3 = integer_literal $Builtin.Int64, 2 // user: %4
%4 = struct $Int (%3 : $Builtin.Int64) // user: %10
%5 = alloc_ref [stack] [tail_elems $Tensor<Float> * %2 : $Builtin.Word] $_ContiguousArrayStorage<Tensor<Float>> // users: %129, %128, %121, %120, %16, %14, %7, %6, %130
%6 = upcast %5 : $_ContiguousArrayStorage<Tensor<Float>> to $_ContiguousArrayStorageBase // users: %15, %12
strong_retain %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %7
%8 = integer_literal $Builtin.Int64, 4 // user: %9
%9 = struct $UInt (%8 : $Builtin.Int64) // user: %10
%10 = struct $_SwiftArrayBodyStorage (%4 : $Int, %9 : $UInt) // user: %11
%11 = struct $_ArrayBody (%10 : $_SwiftArrayBodyStorage) // users: %75, %13
%12 = ref_element_addr %6 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // users: %41, %13
store %11 to %12 : $*_ArrayBody // id: %13
%14 = unchecked_ref_cast %5 : $_ContiguousArrayStorage<Tensor<Float>> to $Builtin.BridgeObject // users: %17, %18, %33, %34, %35, %39, %50, %48, %134, %152, %135, %137, %136, %146, %119, %37, %38, %40
%15 = ref_tail_addr %6 : $_ContiguousArrayStorageBase, $Tensor<Float> // users: %148, %26, %24
strong_release %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %16
strong_retain %14 : $Builtin.BridgeObject // id: %17
strong_release %14 : $Builtin.BridgeObject // id: %18
%19 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %20
%20 = builtin "__tfop_tfc.scalarToTensor,$in"(%19 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %23, %22, %21
%21 = struct $Tensor<Float> (%20 : $TensorHandle<Float>) // user: %24
strong_retain %20 : $TensorHandle<Float> // id: %22
strong_release %20 : $TensorHandle<Float> // id: %23
store %21 to %15 : $*Tensor<Float> // id: %24
%25 = integer_literal $Builtin.Word, 1 // users: %86, %26
%26 = index_addr %15 : $*Tensor<Float>, %25 : $Builtin.Word // user: %32
%27 = float_literal $Builtin.FPIEEE32, 0x40000000 // 2 // user: %28
%28 = builtin "__tfop_tfc.scalarToTensor,$in"(%27 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %31, %30, %29
%29 = struct $Tensor<Float> (%28 : $TensorHandle<Float>) // user: %32
strong_retain %28 : $TensorHandle<Float> // id: %30
strong_release %28 : $TensorHandle<Float> // id: %31
store %29 to %26 : $*Tensor<Float> // id: %32
strong_retain %14 : $Builtin.BridgeObject // id: %33
strong_retain %14 : $Builtin.BridgeObject // id: %34
strong_retain %14 : $Builtin.BridgeObject // id: %35
%36 = integer_literal $Builtin.Int64, 0 // users: %44, %44, %139
strong_retain %14 : $Builtin.BridgeObject // id: %37
strong_release %14 : $Builtin.BridgeObject // id: %38
strong_release %14 : $Builtin.BridgeObject // id: %39
strong_release %14 : $Builtin.BridgeObject // id: %40
%41 = struct_element_addr %12 : $*_ArrayBody, #_ArrayBody._storage // user: %42
%42 = struct_element_addr %41 : $*_SwiftArrayBodyStorage, #_SwiftArrayBodyStorage.count // user: %43
%43 = struct_element_addr %42 : $*Int, #Int._value // users: %123, %140, %49
br bb1(%36 : $Builtin.Int64, %36 : $Builtin.Int64) // id: %44
// %45 // users: %56, %52, %139, %142, %147, %154
// %46 // users: %56, %158, %160
bb1(%45 : $Builtin.Int64, %46 : $Builtin.Int64): // Preds: bb4 bb0
%47 = alloc_stack $Optional<(offset: Int, element: Tensor<Float>)> // users: %55, %118, %67, %59, %170, %164
strong_retain %14 : $Builtin.BridgeObject // id: %48
%49 = load %43 : $*Builtin.Int64 // user: %51
strong_release %14 : $Builtin.BridgeObject // id: %50
%51 = builtin "assumeNonNegative_Int64"(%49 : $Builtin.Int64) : $Builtin.Int64 // user: %52
%52 = builtin "cmp_eq_Int64"(%45 : $Builtin.Int64, %51 : $Builtin.Int64) : $Builtin.Int1 // user: %53
cond_br %52, bb2, bb6 // id: %53
bb2: // Preds: bb1
%54 = enum $Optional<(offset: Int, element: Tensor<Float>)>, #Optional.none!enumelt // user: %55
store %54 to %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %55
br bb3(%46 : $Builtin.Int64, %45 : $Builtin.Int64) // id: %56
// %57 // user: %117
// %58 // user: %117
bb3(%57 : $Builtin.Int64, %58 : $Builtin.Int64): // Preds: bb2 bb6
%59 = load %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // user: %60
switch_enum %59 : $Optional<(offset: Int, element: Tensor<Float>)>, case #Optional.some!enumelt.1: bb4, case #Optional.none!enumelt: bb5 // id: %60
// %61 // users: %63, %62
bb4(%61 : $(offset: Int, element: Tensor<Float>)): // Preds: bb3
%62 = tuple_extract %61 : $(offset: Int, element: Tensor<Float>), 0 // users: %69, %85
%63 = tuple_extract %61 : $(offset: Int, element: Tensor<Float>), 1 // users: %70, %64
%64 = struct_extract %63 : $Tensor<Float>, #Tensor.handle // users: %116, %115, %89, %91, %92, %88, %91, %93, %68, %66, %65
strong_retain %64 : $TensorHandle<Float> // id: %65
strong_release %64 : $TensorHandle<Float> // id: %66
dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %67
strong_retain %64 : $TensorHandle<Float> // id: %68
debug_value %62 : $Int, let, name "i" // id: %69
debug_value %63 : $Tensor<Float>, let, name "x" // id: %70
%71 = alloc_ref [tail_elems $Any * %2 : $Builtin.Word] $_ContiguousArrayStorage<Any> // users: %81, %76, %73, %72
%72 = upcast %71 : $_ContiguousArrayStorage<Any> to $_ContiguousArrayStorageBase // users: %80, %74
strong_retain %71 : $_ContiguousArrayStorage<Any> // id: %73
%74 = ref_element_addr %72 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // user: %75
store %11 to %74 : $*_ArrayBody // id: %75
%76 = unchecked_ref_cast %71 : $_ContiguousArrayStorage<Any> to $Builtin.BridgeObject // users: %82, %83, %114, %77
%77 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%76 : $Builtin.BridgeObject) // user: %78
%78 = struct $_ArrayBuffer<Any> (%77 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %79
%79 = struct $Array<Any> (%78 : $_ArrayBuffer<Any>) // user: %105
%80 = ref_tail_addr %72 : $_ContiguousArrayStorageBase, $Any // users: %84, %86
strong_release %71 : $_ContiguousArrayStorage<Any> // id: %81
strong_retain %76 : $Builtin.BridgeObject // id: %82
strong_release %76 : $Builtin.BridgeObject // id: %83
%84 = init_existential_addr %80 : $*Any, $Int // user: %85
store %62 to %84 : $*Int // id: %85
%86 = index_addr %80 : $*Any, %25 : $Builtin.Word // user: %87
%87 = init_existential_addr %86 : $*Any, $Tensor<Float> // user: %99
strong_retain %64 : $TensorHandle<Float> // id: %88
strong_retain %64 : $TensorHandle<Float> // id: %89
%90 = metatype $@thick Float.Type // user: %91
%91 = builtin "__tfop_Add,$in,$in,T"(%64 : $TensorHandle<Float>, %64 : $TensorHandle<Float>, %90 : $@thick Float.Type) : $TensorHandle<Float> // users: %97, %98, %96, %94, %95
strong_release %64 : $TensorHandle<Float> // id: %92
strong_release %64 : $TensorHandle<Float> // id: %93
strong_retain %91 : $TensorHandle<Float> // id: %94
%95 = struct $Tensor<Float> (%91 : $TensorHandle<Float>) // user: %99
strong_retain %91 : $TensorHandle<Float> // id: %96
strong_release %91 : $TensorHandle<Float> // id: %97
strong_release %91 : $TensorHandle<Float> // id: %98
store %95 to %87 : $*Tensor<Float> // id: %99
// function_ref default argument 1 of print(_:separator:terminator:)
%100 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA0_ : $@convention(thin) () -> @owned String // user: %101
%101 = apply %100() : $@convention(thin) () -> @owned String // users: %110, %105
// function_ref default argument 2 of print(_:separator:terminator:)
%102 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA1_ : $@convention(thin) () -> @owned String // user: %103
%103 = apply %102() : $@convention(thin) () -> @owned String // users: %106, %105
// function_ref print(_:separator:terminator:)
%104 = function_ref @$Ss5print_9separator10terminatoryypd_S2StF : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> () // user: %105
%105 = apply %104(%79, %101, %103) : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> ()
%106 = struct_extract %103 : $String, #String._guts // user: %107
%107 = struct_extract %106 : $_StringGuts, #_StringGuts._object // user: %108
%108 = struct_extract %107 : $_StringObject, #_StringObject._object // user: %109
strong_release %108 : $Builtin.BridgeObject // id: %109
%110 = struct_extract %101 : $String, #String._guts // user: %111
%111 = struct_extract %110 : $_StringGuts, #_StringGuts._object // user: %112
%112 = struct_extract %111 : $_StringObject, #_StringObject._object // user: %113
strong_release %112 : $Builtin.BridgeObject // id: %113
strong_release %76 : $Builtin.BridgeObject // id: %114
strong_release %64 : $TensorHandle<Float> // id: %115
strong_release %64 : $TensorHandle<Float> // id: %116
br bb1(%58 : $Builtin.Int64, %57 : $Builtin.Int64) // id: %117
bb5: // Preds: bb3
dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %118
strong_release %14 : $Builtin.BridgeObject // id: %119
set_deallocating %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %120
%121 = ref_tail_addr %5 : $_ContiguousArrayStorage<Tensor<Float>>, $Tensor<Float> // user: %122
%122 = address_to_pointer %121 : $*Tensor<Float> to $Builtin.RawPointer // user: %127
%123 = load %43 : $*Builtin.Int64 // user: %124
%124 = builtin "assumeNonNegative_Int64"(%123 : $Builtin.Int64) : $Builtin.Int64 // user: %126
%125 = metatype $@thick Tensor<Float>.Type // user: %127
%126 = builtin "truncOrBitCast_Int64_Word"(%124 : $Builtin.Int64) : $Builtin.Word // user: %127
%127 = builtin "destroyArray"<Tensor<Float>>(%125 : $@thick Tensor<Float>.Type, %122 : $Builtin.RawPointer, %126 : $Builtin.Word) : $()
fix_lifetime %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %128
dealloc_ref %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %129
dealloc_ref [stack] %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %130
%131 = integer_literal $Builtin.Int32, 0 // user: %132
%132 = struct $Int32 (%131 : $Builtin.Int32) // user: %133
return %132 : $Int32 // id: %133
bb6: // Preds: bb1
strong_retain %14 : $Builtin.BridgeObject // id: %134
strong_retain %14 : $Builtin.BridgeObject // id: %135
strong_retain %14 : $Builtin.BridgeObject // id: %136
strong_release %14 : $Builtin.BridgeObject // id: %137
%138 = integer_literal $Builtin.Int1, -1 // users: %160, %154, %143
%139 = builtin "cmp_slt_Int64"(%45 : $Builtin.Int64, %36 : $Builtin.Int64) : $Builtin.Int1 // user: %144
%140 = load %43 : $*Builtin.Int64 // user: %141
%141 = builtin "assumeNonNegative_Int64"(%140 : $Builtin.Int64) : $Builtin.Int64 // user: %142
%142 = builtin "cmp_slt_Int64"(%45 : $Builtin.Int64, %141 : $Builtin.Int64) : $Builtin.Int1 // user: %143
%143 = builtin "xor_Int1"(%142 : $Builtin.Int1, %138 : $Builtin.Int1) : $Builtin.Int1 // user: %144
%144 = builtin "or_Int1"(%139 : $Builtin.Int1, %143 : $Builtin.Int1) : $Builtin.Int1 // user: %145
cond_fail %144 : $Builtin.Int1 // id: %145
strong_release %14 : $Builtin.BridgeObject // id: %146
%147 = builtin "truncOrBitCast_Int64_Word"(%45 : $Builtin.Int64) : $Builtin.Word // user: %148
%148 = index_addr %15 : $*Tensor<Float>, %147 : $Builtin.Word // user: %149
%149 = load %148 : $*Tensor<Float> // users: %169, %150
%150 = struct_extract %149 : $Tensor<Float>, #Tensor.handle // users: %172, %171, %168, %159, %151
strong_retain %150 : $TensorHandle<Float> // id: %151
strong_release %14 : $Builtin.BridgeObject // id: %152
%153 = integer_literal $Builtin.Int64, 1 // users: %160, %154
%154 = builtin "sadd_with_overflow_Int64"(%45 : $Builtin.Int64, %153 : $Builtin.Int64, %138 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %156, %155
%155 = tuple_extract %154 : $(Builtin.Int64, Builtin.Int1), 0 // user: %173
%156 = tuple_extract %154 : $(Builtin.Int64, Builtin.Int1), 1 // user: %157
cond_fail %156 : $Builtin.Int1 // id: %157
%158 = struct $Int (%46 : $Builtin.Int64) // user: %167
strong_retain %150 : $TensorHandle<Float> // id: %159
%160 = builtin "sadd_with_overflow_Int64"(%46 : $Builtin.Int64, %153 : $Builtin.Int64, %138 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %162, %161
%161 = tuple_extract %160 : $(Builtin.Int64, Builtin.Int1), 0 // user: %173
%162 = tuple_extract %160 : $(Builtin.Int64, Builtin.Int1), 1 // user: %163
cond_fail %162 : $Builtin.Int1 // id: %163
%164 = init_enum_data_addr %47 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // users: %166, %165
%165 = tuple_element_addr %164 : $*(offset: Int, element: Tensor<Float>), 0 // user: %167
%166 = tuple_element_addr %164 : $*(offset: Int, element: Tensor<Float>), 1 // user: %169
store %158 to %165 : $*Int // id: %167
strong_retain %150 : $TensorHandle<Float> // id: %168
store %149 to %166 : $*Tensor<Float> // id: %169
inject_enum_addr %47 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // id: %170
strong_release %150 : $TensorHandle<Float> // id: %171
strong_release %150 : $TensorHandle<Float> // id: %172
br bb3(%161 : $Builtin.Int64, %155 : $Builtin.Int64) // id: %173
} // end sil function 'main'
---- END OF INPUT FUNCTION ----------
---- ANALYSIS STATE FOR FUNCTION main ----------
Tensor start point: %19 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %20
Tensor end point: dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %119
SIL with markings:
bb0:
%0 = argument of bb0 : $Int32
%1 = argument of bb0 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>
%2 = integer_literal $Builtin.Word, 2 // users: %71, %5
%3 = integer_literal $Builtin.Int64, 2 // user: %4
%4 = struct $Int (%3 : $Builtin.Int64) // user: %10
%5 = alloc_ref [stack] [tail_elems $Tensor<Float> * %2 : $Builtin.Word] $_ContiguousArrayStorage<Tensor<Float>> // users: %130, %129, %122, %121, %16, %14, %7, %6, %131
%6 = upcast %5 : $_ContiguousArrayStorage<Tensor<Float>> to $_ContiguousArrayStorageBase // users: %15, %12
strong_retain %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %7
%8 = integer_literal $Builtin.Int64, 4 // user: %9
%9 = struct $UInt (%8 : $Builtin.Int64) // user: %10
%10 = struct $_SwiftArrayBodyStorage (%4 : $Int, %9 : $UInt) // user: %11
%11 = struct $_ArrayBody (%10 : $_SwiftArrayBodyStorage) // users: %75, %13
%12 = ref_element_addr %6 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // users: %41, %13
store %11 to %12 : $*_ArrayBody // id: %13
%14 = unchecked_ref_cast %5 : $_ContiguousArrayStorage<Tensor<Float>> to $Builtin.BridgeObject // users: %17, %18, %33, %34, %35, %39, %50, %48, %135, %153, %136, %138, %137, %147, %120, %37, %38, %40
%15 = ref_tail_addr %6 : $_ContiguousArrayStorageBase, $Tensor<Float> // users: %149, %26, %24
strong_release %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %16
strong_retain %14 : $Builtin.BridgeObject // id: %17
strong_release %14 : $Builtin.BridgeObject // id: %18
[Move] %19 = float_literal $Builtin.FPIEEE32, 0x3F800000 // 1 // user: %20
[Move] %20 = builtin "__tfop_tfc.scalarToTensor,$in"(%19 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %21, %22, %23
%21 = struct $Tensor<Float> (%20 : $TensorHandle<Float>) // user: %24
strong_retain %20 : $TensorHandle<Float> // id: %22
strong_release %20 : $TensorHandle<Float> // id: %23
store %21 to %15 : $*Tensor<Float> // id: %24
%25 = integer_literal $Builtin.Word, 1 // users: %86, %26
%26 = index_addr %15 : $*Tensor<Float>, %25 : $Builtin.Word // user: %32
[Move] %27 = float_literal $Builtin.FPIEEE32, 0x40000000 // 2 // user: %28
[Move] %28 = builtin "__tfop_tfc.scalarToTensor,$in"(%27 : $Builtin.FPIEEE32) : $TensorHandle<Float> // users: %29, %30, %31
%29 = struct $Tensor<Float> (%28 : $TensorHandle<Float>) // user: %32
strong_retain %28 : $TensorHandle<Float> // id: %30
strong_release %28 : $TensorHandle<Float> // id: %31
store %29 to %26 : $*Tensor<Float> // id: %32
strong_retain %14 : $Builtin.BridgeObject // id: %33
strong_retain %14 : $Builtin.BridgeObject // id: %34
strong_retain %14 : $Builtin.BridgeObject // id: %35
%36 = integer_literal $Builtin.Int64, 0 // users: %44, %44, %140
strong_retain %14 : $Builtin.BridgeObject // id: %37
strong_release %14 : $Builtin.BridgeObject // id: %38
strong_release %14 : $Builtin.BridgeObject // id: %39
strong_release %14 : $Builtin.BridgeObject // id: %40
%41 = struct_element_addr %12 : $*_ArrayBody, #_ArrayBody._storage // user: %42
%42 = struct_element_addr %41 : $*_SwiftArrayBodyStorage, #_SwiftArrayBodyStorage.count // user: %43
%43 = struct_element_addr %42 : $*Int, #Int._value // users: %124, %141, %49
br bb1(%36 : $Builtin.Int64, %36 : $Builtin.Int64) // id: %44
bb1:
%45 = argument of bb1 : $Builtin.Int64 // users: %56, %52, %140, %143, %148, %155
%46 = argument of bb1 : $Builtin.Int64 // users: %56, %159, %161
%47 = alloc_stack $Optional<(offset: Int, element: Tensor<Float>)> // users: %55, %119, %67, %59, %171, %165
strong_retain %14 : $Builtin.BridgeObject // id: %48
%49 = load %43 : $*Builtin.Int64 // user: %51
strong_release %14 : $Builtin.BridgeObject // id: %50
%51 = builtin "assumeNonNegative_Int64"(%49 : $Builtin.Int64) : $Builtin.Int64 // user: %52
%52 = builtin "cmp_eq_Int64"(%45 : $Builtin.Int64, %51 : $Builtin.Int64) : $Builtin.Int1 // user: %53
cond_br %52, bb2, bb6 // id: %53
bb2:
%54 = enum $Optional<(offset: Int, element: Tensor<Float>)>, #Optional.none!enumelt // user: %55
store %54 to %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %55
br bb3(%46 : $Builtin.Int64, %45 : $Builtin.Int64) // id: %56
bb3:
%57 = argument of bb3 : $Builtin.Int64 // user: %118
%58 = argument of bb3 : $Builtin.Int64 // user: %118
%59 = load %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // user: %60
[Send] switch_enum %59 : $Optional<(offset: Int, element: Tensor<Float>)>, case #Optional.some!enumelt.1: bb4, case #Optional.none!enumelt: bb5 // id: %60
bb4:
%61 = argument of bb4 : $(offset: Int, element: Tensor<Float>) // users: %63, %62
%62 = tuple_extract %61 : $(offset: Int, element: Tensor<Float>), 0 // users: %69, %85
%63 = tuple_extract %61 : $(offset: Int, element: Tensor<Float>), 1 // users: %70, %64
[Send] %64 = struct_extract %63 : $Tensor<Float>, #Tensor.handle // users: %92, %92, %117, %116, %89, %93, %88, %94, %68, %66, %65
strong_retain %64 : $TensorHandle<Float> // id: %65
strong_release %64 : $TensorHandle<Float> // id: %66
dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %67
strong_retain %64 : $TensorHandle<Float> // id: %68
debug_value %62 : $Int, let, name "i" // id: %69
debug_value %63 : $Tensor<Float>, let, name "x" // id: %70
%71 = alloc_ref [tail_elems $Any * %2 : $Builtin.Word] $_ContiguousArrayStorage<Any> // users: %81, %76, %73, %72
%72 = upcast %71 : $_ContiguousArrayStorage<Any> to $_ContiguousArrayStorageBase // users: %80, %74
strong_retain %71 : $_ContiguousArrayStorage<Any> // id: %73
%74 = ref_element_addr %72 : $_ContiguousArrayStorageBase, #_ContiguousArrayStorageBase.countAndCapacity // user: %75
store %11 to %74 : $*_ArrayBody // id: %75
%76 = unchecked_ref_cast %71 : $_ContiguousArrayStorage<Any> to $Builtin.BridgeObject // users: %82, %83, %115, %77
%77 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%76 : $Builtin.BridgeObject) // user: %78
%78 = struct $_ArrayBuffer<Any> (%77 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %79
%79 = struct $Array<Any> (%78 : $_ArrayBuffer<Any>) // user: %106
%80 = ref_tail_addr %72 : $_ContiguousArrayStorageBase, $Any // users: %84, %86
strong_release %71 : $_ContiguousArrayStorage<Any> // id: %81
strong_retain %76 : $Builtin.BridgeObject // id: %82
strong_release %76 : $Builtin.BridgeObject // id: %83
%84 = init_existential_addr %80 : $*Any, $Int // user: %85
store %62 to %84 : $*Int // id: %85
%86 = index_addr %80 : $*Any, %25 : $Builtin.Word // user: %87
%87 = init_existential_addr %86 : $*Any, $Tensor<Float> // user: %100
strong_retain %64 : $TensorHandle<Float> // id: %88
strong_retain %64 : $TensorHandle<Float> // id: %89
%90 = metatype $@thick Float.Type // user: %92
%91 = string_literal utf8 "/device:CPU:0" // user: %92
[Move] %92 = builtin "__tfop_Add,$in,$in,T,__device"(%64 : $TensorHandle<Float>, %64 : $TensorHandle<Float>, %90 : $@thick Float.Type, %91 : $Builtin.RawPointer) : $TensorHandle<Float> // users: %96, %95, %97, %99, %98
strong_release %64 : $TensorHandle<Float> // id: %93
strong_release %64 : $TensorHandle<Float> // id: %94
strong_retain %92 : $TensorHandle<Float> // id: %95
%96 = struct $Tensor<Float> (%92 : $TensorHandle<Float>) // user: %100
strong_retain %92 : $TensorHandle<Float> // id: %97
strong_release %92 : $TensorHandle<Float> // id: %98
strong_release %92 : $TensorHandle<Float> // id: %99
store %96 to %87 : $*Tensor<Float> // id: %100
// function_ref default argument 1 of print(_:separator:terminator:)
%101 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA0_ : $@convention(thin) () -> @owned String // user: %102
%102 = apply %101() : $@convention(thin) () -> @owned String // users: %111, %106
// function_ref default argument 2 of print(_:separator:terminator:)
%103 = function_ref @$Ss5print_9separator10terminatoryypd_S2StFfA1_ : $@convention(thin) () -> @owned String // user: %104
%104 = apply %103() : $@convention(thin) () -> @owned String // users: %107, %106
// function_ref print(_:separator:terminator:)
%105 = function_ref @$Ss5print_9separator10terminatoryypd_S2StF : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> () // user: %106
%106 = apply %105(%79, %102, %104) : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> ()
%107 = struct_extract %104 : $String, #String._guts // user: %108
%108 = struct_extract %107 : $_StringGuts, #_StringGuts._object // user: %109
%109 = struct_extract %108 : $_StringObject, #_StringObject._object // user: %110
strong_release %109 : $Builtin.BridgeObject // id: %110
%111 = struct_extract %102 : $String, #String._guts // user: %112
%112 = struct_extract %111 : $_StringGuts, #_StringGuts._object // user: %113
%113 = struct_extract %112 : $_StringObject, #_StringObject._object // user: %114
strong_release %113 : $Builtin.BridgeObject // id: %114
strong_release %76 : $Builtin.BridgeObject // id: %115
strong_release %64 : $TensorHandle<Float> // id: %116
strong_release %64 : $TensorHandle<Float> // id: %117
br bb1(%58 : $Builtin.Int64, %57 : $Builtin.Int64) // id: %118
bb5:
dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %119
strong_release %14 : $Builtin.BridgeObject // id: %120
set_deallocating %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %121
%122 = ref_tail_addr %5 : $_ContiguousArrayStorage<Tensor<Float>>, $Tensor<Float> // user: %123
%123 = address_to_pointer %122 : $*Tensor<Float> to $Builtin.RawPointer // user: %128
%124 = load %43 : $*Builtin.Int64 // user: %125
%125 = builtin "assumeNonNegative_Int64"(%124 : $Builtin.Int64) : $Builtin.Int64 // user: %127
%126 = metatype $@thick Tensor<Float>.Type // user: %128
%127 = builtin "truncOrBitCast_Int64_Word"(%125 : $Builtin.Int64) : $Builtin.Word // user: %128
%128 = builtin "destroyArray"<Tensor<Float>>(%126 : $@thick Tensor<Float>.Type, %123 : $Builtin.RawPointer, %127 : $Builtin.Word) : $()
fix_lifetime %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %129
dealloc_ref %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %130
dealloc_ref [stack] %5 : $_ContiguousArrayStorage<Tensor<Float>> // id: %131
%132 = integer_literal $Builtin.Int32, 0 // user: %133
%133 = struct $Int32 (%132 : $Builtin.Int32) // user: %134
return %133 : $Int32 // id: %134
bb6:
strong_retain %14 : $Builtin.BridgeObject // id: %135
strong_retain %14 : $Builtin.BridgeObject // id: %136
strong_retain %14 : $Builtin.BridgeObject // id: %137
strong_release %14 : $Builtin.BridgeObject // id: %138
%139 = integer_literal $Builtin.Int1, -1 // users: %161, %155, %144
%140 = builtin "cmp_slt_Int64"(%45 : $Builtin.Int64, %36 : $Builtin.Int64) : $Builtin.Int1 // user: %145
%141 = load %43 : $*Builtin.Int64 // user: %142
%142 = builtin "assumeNonNegative_Int64"(%141 : $Builtin.Int64) : $Builtin.Int64 // user: %143
%143 = builtin "cmp_slt_Int64"(%45 : $Builtin.Int64, %142 : $Builtin.Int64) : $Builtin.Int1 // user: %144
%144 = builtin "xor_Int1"(%143 : $Builtin.Int1, %139 : $Builtin.Int1) : $Builtin.Int1 // user: %145
%145 = builtin "or_Int1"(%140 : $Builtin.Int1, %144 : $Builtin.Int1) : $Builtin.Int1 // user: %146
cond_fail %145 : $Builtin.Int1 // id: %146
strong_release %14 : $Builtin.BridgeObject // id: %147
%148 = builtin "truncOrBitCast_Int64_Word"(%45 : $Builtin.Int64) : $Builtin.Word // user: %149
%149 = index_addr %15 : $*Tensor<Float>, %148 : $Builtin.Word // user: %150
%150 = load %149 : $*Tensor<Float> // users: %170, %151
%151 = struct_extract %150 : $Tensor<Float>, #Tensor.handle // users: %173, %172, %169, %160, %152
strong_retain %151 : $TensorHandle<Float> // id: %152
strong_release %14 : $Builtin.BridgeObject // id: %153
%154 = integer_literal $Builtin.Int64, 1 // users: %161, %155
%155 = builtin "sadd_with_overflow_Int64"(%45 : $Builtin.Int64, %154 : $Builtin.Int64, %139 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %157, %156
%156 = tuple_extract %155 : $(Builtin.Int64, Builtin.Int1), 0 // user: %174
%157 = tuple_extract %155 : $(Builtin.Int64, Builtin.Int1), 1 // user: %158
cond_fail %157 : $Builtin.Int1 // id: %158
%159 = struct $Int (%46 : $Builtin.Int64) // user: %168
strong_retain %151 : $TensorHandle<Float> // id: %160
%161 = builtin "sadd_with_overflow_Int64"(%46 : $Builtin.Int64, %154 : $Builtin.Int64, %139 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1) // users: %163, %162
%162 = tuple_extract %161 : $(Builtin.Int64, Builtin.Int1), 0 // user: %174
%163 = tuple_extract %161 : $(Builtin.Int64, Builtin.Int1), 1 // user: %164
cond_fail %163 : $Builtin.Int1 // id: %164
%165 = init_enum_data_addr %47 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // users: %167, %166
%166 = tuple_element_addr %165 : $*(offset: Int, element: Tensor<Float>), 0 // user: %168
%167 = tuple_element_addr %165 : $*(offset: Int, element: Tensor<Float>), 1 // user: %170
store %159 to %166 : $*Int // id: %168
strong_retain %151 : $TensorHandle<Float> // id: %169
store %150 to %167 : $*Tensor<Float> // id: %170
inject_enum_addr %47 : $*Optional<(offset: Int, element: Tensor<Float>)>, #Optional.some!enumelt.1 // id: %171
strong_release %151 : $TensorHandle<Float> // id: %172
strong_release %151 : $TensorHandle<Float> // id: %173
br bb3(%162 : $Builtin.Int64, %156 : $Builtin.Int64) // id: %174
---- END OF ANALYSIS STATE FOR FUNCTION ----------
---- PARTITION STATE FOR FUNCTION main ----------
(Possibly updated) tensor end point: dealloc_stack %47 : $*Optional<(offset: Int, element: Tensor<Float>)> // id: %119
There are 0 result values:
---- END OF PARTITION STATE FOR FUNCTION ----------
--- TFPartition Accelerator Result: main.tf
// main.tf
sil private @main.tf : $@callee_owned () -> () {
bb0:
%0 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x3F800000 /* 1 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %1
%1 = unchecked_ref_cast %0 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %2
%2 = graph_op "tfc.SendToHost,i"(%1 : $TensorHandle<Float>) {tensorId: i32 1, __device: "/device:CPU:0"} : $()
%3 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x40000000 /* 2 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %4
%4 = unchecked_ref_cast %3 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %5
%5 = graph_op "tfc.SendToHost,i"(%4 : $TensorHandle<Float>) {tensorId: i32 2, __device: "/device:CPU:0"} : $()
br bb2 // id: %6
bb1:
%7 = graph_op "tfc.RecvFromHost"() {tensorId: i32 0, __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %10, %10
%8 = metatype $@thick Float.Type // user: %10
%9 = string_literal utf8 "/device:CPU:0" // user: %10
%10 = builtin "__tfop_Add,$in,$in,T,__device"(%7 : $TensorHandle<Float>, %7 : $TensorHandle<Float>, %8 : $@thick Float.Type, %9 : $Builtin.RawPointer) : $TensorHandle<Float> // user: %11
%11 = graph_op "tfc.SendToHost,i"(%10 : $TensorHandle<Float>) {tensorId: i32 3, __device: "/device:CPU:0"} : $()
br bb2 // id: %12
bb2: // Preds: bb1 bb0
%13 = tuple () // user: %14
return %13 : $() // id: %14
} // end sil function 'main.tf'
----
--- XLA CFG Canonicalize: main.tf
[sequence
block bb0
block bb2]
--- XLA CFG Canonicalize end
----
--- TFDevicePartition Cross Device Tensor Transfer Annotation Result: main.tf
// main.tf
sil private @main.tf : $@callee_owned () -> () {
bb0:
%0 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x3F800000 /* 1 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %1
%1 = unchecked_ref_cast %0 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %2
%2 = graph_op "tfc.SendToHost,i"(%1 : $TensorHandle<Float>) {tensorId: i32 1, __device: "/device:CPU:0"} : $()
%3 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x40000000 /* 2 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %4
%4 = unchecked_ref_cast %3 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %5
%5 = graph_op "tfc.SendToHost,i"(%4 : $TensorHandle<Float>) {tensorId: i32 2, __device: "/device:CPU:0"} : $()
br bb2 // id: %6
bb1:
%7 = graph_op "tfc.RecvFromHost"() {tensorId: i32 0, __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %10, %10
%8 = metatype $@thick Float.Type // user: %10
%9 = string_literal utf8 "/device:CPU:0" // user: %10
%10 = builtin "__tfop_Add,$in,$in,T,__device"(%7 : $TensorHandle<Float>, %7 : $TensorHandle<Float>, %8 : $@thick Float.Type, %9 : $Builtin.RawPointer) : $TensorHandle<Float> // user: %11
%11 = graph_op "tfc.SendToHost,i"(%10 : $TensorHandle<Float>) {tensorId: i32 3, __device: "/device:CPU:0"} : $()
br bb2 // id: %12
bb2: // Preds: bb1 bb0
%13 = tuple () // user: %14
return %13 : $() // id: %14
} // end sil function 'main.tf'
----
--- TFDevicePartition Per-Device Function Extraction Result: main.tf_CPU.device_partition
// main.tf_CPU.device_partition
sil private @main.tf_CPU.device_partition : $@callee_owned () -> () {
bb0:
%0 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x3F800000 /* 1 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %1
%1 = unchecked_ref_cast %0 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %2
%2 = graph_op "tfc.SendToHost,i"(%1 : $TensorHandle<Float>) {tensorId: i32 1, __device: "/device:CPU:0"} : $()
%3 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x40000000 /* 2 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %4
%4 = unchecked_ref_cast %3 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %5
%5 = graph_op "tfc.SendToHost,i"(%4 : $TensorHandle<Float>) {tensorId: i32 2, __device: "/device:CPU:0"} : $()
br bb2 // id: %6
bb1:
bb2: // Preds: bb0
%7 = tuple () // user: %8
return %7 : $() // id: %8
} // end sil function 'main.tf_CPU.device_partition'
----
SIL verification failed: Basic blocks cannot be empty: !BB.empty()
In function:
// main.tf_CPU.device_partition
sil private @main.tf_CPU.device_partition : $@callee_owned () -> () {
bb0:
%0 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x3F800000 /* 1 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %1
%1 = unchecked_ref_cast %0 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %2
%2 = graph_op "tfc.SendToHost,i"(%1 : $TensorHandle<Float>) {tensorId: i32 1, __device: "/device:CPU:0"} : $()
%3 = graph_op "Const"() {dtype$dtype: $Builtin.FPIEEE32, value$tensor: f32 0x40000000 /* 2 */, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %4
%4 = unchecked_ref_cast %3 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %5
%5 = graph_op "tfc.SendToHost,i"(%4 : $TensorHandle<Float>) {tensorId: i32 2, __device: "/device:CPU:0"} : $()
br bb2 // id: %6
bb1:
bb2: // Preds: bb0
%7 = tuple () // user: %8
return %7 : $() // id: %8
} // end sil function 'main.tf_CPU.device_partition'
0 swift 0x00000001090cd638 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x00000001090cc877 llvm::sys::RunSignalHandlers() + 39
2 swift 0x00000001090cdcb2 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff4fe25f5a _sigtramp + 26
4 libsystem_platform.dylib 000000000000000000 _sigtramp + 2954731712
5 libsystem_c.dylib 0x00007fff4fbc31ae abort + 127
6 swift 0x00000001065e57ed (anonymous namespace)::SILVerifier::_require(bool, llvm::Twine const&, std::__1::function<void ()> const&) + 509
7 swift 0x00000001065e2709 (anonymous namespace)::SILVerifier::SILVerifier(swift::SILFunction const&, bool) + 537
8 swift 0x00000001065dfdfa swift::SILFunction::verify(bool) const + 42
9 swift 0x0000000106227d18 swift::tf::DevicePartitionerImpl::extractFunctionForDevice(swift::tf::DeviceType) + 4120
10 swift 0x000000010623c9e3 lowerTFGraphOrFunction(swift::SILFunction*, swift::tf::GraphGlobalConfiguration const&, bool, llvm::DenseMap<llvm::StringRef, swift::tf::SerializedGraphFunction, llvm::DenseMapInfo<llvm::StringRef>, llvm::detail::DenseMapPair<llvm::StringRef, swift::tf::SerializedGraphFunction> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 931
11 swift 0x000000010623fde9 swift::tf::lowerTFGraph(swift::SILFunction*, swift::tf::GraphGlobalConfiguration const&, llvm::DenseMap<llvm::StringRef, swift::tf::SerializedGraphFunction, llvm::DenseMapInfo<llvm::StringRef>, llvm::detail::DenseMapPair<llvm::StringRef, swift::tf::SerializedGraphFunction> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 25
12 swift 0x00000001062562be (anonymous namespace)::TFPartition::run() + 4798
13 swift 0x0000000106178731 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) + 1441
14 swift 0x0000000106179713 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 1315
15 swift 0x000000010617a424 swift::SILPassManager::execute() + 644
16 swift 0x000000010597902b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 187
17 swift 0x00000001061828f3 swift::runSILTFPartitionPass(swift::SILModule&) + 99
18 swift 0x00000001058113a8 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13480
19 swift 0x000000010580ce8a swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2938
20 swift 0x00000001057c7d8d main + 2317
21 libdyld.dylib 0x00007fff4fb17015 start + 1
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2018-07-12-a.xctoolchain/usr/bin/swift -frontend -interpret enumerated.swift -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -O -Xllvm -tf-dump-intermediates -module-name enumerated
1. While running pass #2 SILFunctionTransform "TFPartition" on SILFunction "@main".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment