1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15.class public LTypePropagation;
16.super Ljava/lang/Object;
17
18## CHECK-START-DEBUGGABLE: void TypePropagation.mergeDeadPhi(boolean, boolean, int, float, float) builder (after)
19## CHECK-NOT: Phi
20.method public static mergeDeadPhi(ZZIFF)V
21  .registers 8
22
23  if-eqz p0, :after1
24  move p2, p3
25  :after1
26  # p2 = merge(int,float) = conflict
27
28  if-eqz p1, :after2
29  move p2, p4
30  :after2
31  # p2 = merge(conflict,float) = conflict
32
33  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
34  return-void
35.end method
36
37## CHECK-START-DEBUGGABLE: void TypePropagation.mergeSameType(boolean, int, int) builder (after)
38## CHECK:     {{i\d+}} Phi
39## CHECK-NOT:          Phi
40.method public static mergeSameType(ZII)V
41  .registers 8
42  if-eqz p0, :after
43  move p1, p2
44  :after
45  # p1 = merge(int,int) = int
46  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
47  return-void
48.end method
49
50## CHECK-START-DEBUGGABLE: void TypePropagation.mergeVoidInput(boolean, boolean, int, int) builder (after)
51## CHECK:     {{i\d+}} Phi
52## CHECK:     {{i\d+}} Phi
53## CHECK-NOT:          Phi
54.method public static mergeVoidInput(ZZII)V
55  .registers 8
56  :loop
57  # p2 = void (loop phi) => p2 = merge(int,int) = int
58  if-eqz p0, :after
59  move p2, p3
60  :after
61  # p2 = merge(void,int) = int
62  if-eqz p1, :loop
63  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
64  return-void
65.end method
66
67## CHECK-START-DEBUGGABLE: void TypePropagation.mergeDifferentSize(boolean, int, long) builder (after)
68## CHECK-NOT: Phi
69.method public static mergeDifferentSize(ZIJ)V
70  .registers 8
71  if-eqz p0, :after
72  move-wide p1, p2
73  :after
74  # p1 = merge(int,long) = conflict
75  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
76  return-void
77.end method
78
79## CHECK-START-DEBUGGABLE: void TypePropagation.mergeRefFloat(boolean, float, java.lang.Object) builder (after)
80## CHECK-NOT: Phi
81.method public static mergeRefFloat(ZFLjava/lang/Object;)V
82  .registers 8
83  if-eqz p0, :after
84  move-object p1, p2
85  :after
86  # p1 = merge(float,reference) = conflict
87  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
88  return-void
89.end method
90
91## CHECK-START-DEBUGGABLE: void TypePropagation.mergeIntFloat_Success(boolean, float) builder (after)
92## CHECK:     {{f\d+}} Phi
93## CHECK-NOT:          Phi
94.method public static mergeIntFloat_Success(ZF)V
95  .registers 8
96  if-eqz p0, :after
97  const/4 p1, 0x0
98  :after
99  # p1 = merge(float,0x0) = float
100  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
101  return-void
102.end method
103
104## CHECK-START-DEBUGGABLE: void TypePropagation.mergeIntFloat_Fail(boolean, int, float) builder (after)
105## CHECK-NOT: Phi
106.method public static mergeIntFloat_Fail(ZIF)V
107  .registers 8
108  if-eqz p0, :after
109  move p1, p2
110  :after
111  # p1 = merge(int,float) = conflict
112  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
113  return-void
114.end method
115
116## CHECK-START-DEBUGGABLE: void TypePropagation.updateAllUsersOnConflict(boolean, boolean, int, float, int) builder (after)
117## CHECK-NOT: Phi
118.method public static updateAllUsersOnConflict(ZZIFI)V
119  .registers 8
120
121  :loop1
122  # loop phis for all args
123  # p2 = merge(int,float) = float? => conflict
124  move p2, p3
125  if-eqz p0, :loop1
126
127  :loop2
128  # loop phis for all args
129  # requests float equivalent of p4 phi in loop1 => conflict
130  # propagates conflict to loop2's phis
131  move p2, p4
132  if-eqz p1, :loop2
133
134  invoke-static {}, Ljava/lang/System;->nanoTime()J  # create an env use
135  return-void
136.end method
137