已合并
Fix pgo type confilict caused by loop peeling #7005
zhangyukun8创建于 2024年4月19日
Fix pgo type confilict caused by loop peeling #7005
已合并
zhangyukun8创建于 2024年4月19日
refs/pull/7005/head合入到master
6 个文件变更+80-0
@@ -106,6 +106,9 @@ public:
106 106 
107 inline ParamType GetParamType() const107 inline ParamType GetParamType() const
108 {108 {
109+ if (LeftOrRightIsUndefinedOrNull()) {
110+ return ParamType::AnyType();
111+ }
109 return PGOSampleTypeToParamType();112 return PGOSampleTypeToParamType();
110 }113 }
111 114 
@@ -216,6 +216,7 @@ group("ark_aot_ts_test") {
216 "pgo_ldobjbyvalue_array",216 "pgo_ldobjbyvalue_array",
217 "pgo_ldobjbyvalue_string",217 "pgo_ldobjbyvalue_string",
218 "pgo_length",218 "pgo_length",
219+ "pgo_loop_peeling",
219 "pgo_objectliteral_operation",220 "pgo_objectliteral_operation",
220 "pgo_call_deopt_js",221 "pgo_call_deopt_js",
221 "pgo_call_recursive_js",222 "pgo_call_recursive_js",
@@ -0,0 +1,22 @@
1+# Copyright (c) 2024 Huawei Device Co., Ltd.
2+# Licensed under the Apache License, Version 2.0 (the "License");
3+# you may not use this file except in compliance with the License.
4+# You may obtain a copy of the License at
5+#
6+# http://www.apache.org/licenses/LICENSE-2.0
7+#
8+# Unless required by applicable law or agreed to in writing, software
9+# distributed under the License is distributed on an "AS IS" BASIS,
10+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+# See the License for the specific language governing permissions and
12+# limitations under the License.
13+ 
14+import("//arkcompiler/ets_runtime/test/test_helper.gni")
15+ 
16+host_aot_test_action("pgo_loop_peeling") {
17+ deps = []
18+ is_only_typed_path = true
19+ is_enable_pgo = true
20+ is_enable_opt_loop_peeling = true
21+ log_option = " --log-info=trace"
22+}
@@ -0,0 +1,14 @@
1+# Copyright (c) 2024 Huawei Device Co., Ltd.
2+# Licensed under the Apache License, Version 2.0 (the "License");
3+# you may not use this file except in compliance with the License.
4+# You may obtain a copy of the License at
5+#
6+# http://www.apache.org/licenses/LICENSE-2.0
7+#
8+# Unless required by applicable law or agreed to in writing, software
9+# distributed under the License is distributed on an "AS IS" BASIS,
10+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+# See the License for the specific language governing permissions and
12+# limitations under the License.
13+ 
14+undefinedbbb
@@ -0,0 +1,14 @@
1+# Copyright (c) 2024 Huawei Device Co., Ltd.
2+# Licensed under the Apache License, Version 2.0 (the "License");
3+# you may not use this file except in compliance with the License.
4+# You may obtain a copy of the License at
5+#
6+# http://www.apache.org/licenses/LICENSE-2.0
7+#
8+# Unless required by applicable law or agreed to in writing, software
9+# distributed under the License is distributed on an "AS IS" BASIS,
10+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+# See the License for the specific language governing permissions and
12+# limitations under the License.
13+ 
14+undefinedbbb
@@ -0,0 +1,26 @@
1+/*
2+ * Copyright (c) 2024 Huawei Device Co., Ltd.
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+ 
16+declare function print(arg:any):string;
17+ 
18+let a = undefined
19+for (let i = 0; i < 10; i++) {
20+ if (a !== "undefinedbbb") {
21+ a += "b"
22+ } else {
23+ break
24+ }
25+}
26+print(a)