@@ -102,18 +102,18 @@ module {
102102// CUDA-NEXT: }
103103
104104// TPU: func.func @main2(%arg0: tensor<64x32xf32>, %arg1: tensor<64x64xf32>) -> tensor<64x64xf32> {
105- // TPU-NEXT: %cst = stablehlo.constant dense<3 .000000e+00> : tensor<64x64xf32>
106- // TPU-NEXT: %cst_0 = stablehlo.constant dense<2 .000000e+00> : tensor<64x64xf32>
105+ // TPU-NEXT: %[[cst2:.+]] = stablehlo.constant dense<2 .000000e+00> : tensor<64x64xf32>
106+ // TPU-NEXT: %[[cst3:.+]] = stablehlo.constant dense<3 .000000e+00> : tensor<64x64xf32>
107107// TPU-NEXT: %0 = stablehlo.iota dim = 0 : tensor<64x64xi32>
108108// TPU-NEXT: %1 = stablehlo.iota dim = 1 : tensor<64x64xi32>
109109// TPU-NEXT: %2 = stablehlo.compare GT, %0, %1 : (tensor<64x64xi32>, tensor<64x64xi32>) -> tensor<64x64xi1>
110110// TPU-NEXT: %3 = stablehlo.transpose %arg1, dims = [1, 0] : (tensor<64x64xf32>) -> tensor<64x64xf32>
111111// TPU-NEXT: %4 = stablehlo.select %2, %arg1, %3 : tensor<64x64xi1>, tensor<64x64xf32>
112112// TPU-NEXT: %5 = stablehlo.dot_general %arg0, %arg0, contracting_dims = [1] x [1] : (tensor<64x32xf32>, tensor<64x32xf32>) -> tensor<64x64xf32>
113- // TPU-NEXT: %6 = stablehlo.multiply %cst_0 , %5 : tensor<64x64xf32>
114- // TPU-NEXT: %7 = stablehlo.multiply %cst , %4 : tensor<64x64xf32>
115- // TPU-NEXT: %8 = stablehlo.add %6 , %7 : tensor<64x64xf32>
116- // TPU-NEXT: return %8 : tensor<64x64xf32>
113+ // TPU-NEXT: %[[a7:.+]] = stablehlo.multiply %[[cst3]] , %4 : tensor<64x64xf32>
114+ // TPU-NEXT: %[[a6:.+]] = stablehlo.multiply %[[cst2]] , %5 : tensor<64x64xf32>
115+ // TPU-NEXT: %[[a8:.+]] = stablehlo.add %[[a6]] , %[[a7]] : tensor<64x64xf32>
116+ // TPU-NEXT: return %[[a8]] : tensor<64x64xf32>
117117// TPU-NEXT: }
118118
119119module {
@@ -157,8 +157,8 @@ module {
157157// TPU-NEXT: %[[cst2:.+]] = stablehlo.constant dense<2.000000e+00> : tensor<64x64xf32>
158158// TPU-NEXT: %[[cst3:.+]] = stablehlo.constant dense<3.000000e+00> : tensor<64x64xf32>
159159// TPU-NEXT: %[[a0:.+]] = stablehlo.dot_general %arg0, %arg0, contracting_dims = [1] x [1] : (tensor<64x32xf32>, tensor<64x32xf32>) -> tensor<64x64xf32>
160- // TPU-NEXT: %[[a1:.+]] = stablehlo.multiply %[[cst2]], %[[a0]] : tensor<64x64xf32>
161160// TPU-NEXT: %[[a2:.+]] = stablehlo.multiply %[[cst3]], %arg1 : tensor<64x64xf32>
161+ // TPU-NEXT: %[[a1:.+]] = stablehlo.multiply %[[cst2]], %[[a0]] : tensor<64x64xf32>
162162// TPU-NEXT: %[[a3:.+]] = stablehlo.add %[[a1]], %[[a2]] : tensor<64x64xf32>
163163// TPU-NEXT: return %[[a3]] : tensor<64x64xf32>
164164// TPU-NEXT: }
0 commit comments