mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Fix compiler failure due to error elimination
Fix compiler failure due to error elimination in early_elimination Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I92P92 Signed-off-by: weng-xi <wengxi1@huawei.com> Change-Id: Idb7c9e6bbd9434dcf04fd522b98b576a6d732e1f
This commit is contained in:
parent
a2a5dc4737
commit
3acde2d52a
@ -379,6 +379,9 @@ bool EarlyElimination::CheckReplacement(GateRef lhs, GateRef rhs)
|
||||
if (acc_.GetOffset(lhs) != acc_.GetOffset(rhs)) {
|
||||
return false;
|
||||
}
|
||||
if (acc_.GetMachineType(lhs) != acc_.GetMachineType(rhs)) {
|
||||
return false;
|
||||
}
|
||||
if (acc_.GetMemoryOrder(lhs).Value() != acc_.GetMemoryOrder(rhs).Value()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -197,6 +197,7 @@ group("ark_aot_ts_test") {
|
||||
"pgo_class_operation",
|
||||
"pgo_class_prototype",
|
||||
"pgo_constructor_number",
|
||||
"pgo_elimination_loadconstoffset",
|
||||
"pgo_forof_array",
|
||||
"pgo_forof_map",
|
||||
"pgo_forof_set",
|
||||
|
20
test/aottest/pgo_elimination_loadconstoffset/BUILD.gn
Normal file
20
test/aottest/pgo_elimination_loadconstoffset/BUILD.gn
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_aot_test_action("pgo_elimination_loadconstoffset") {
|
||||
deps = []
|
||||
is_only_typed_path = true
|
||||
is_enable_pgo = true
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
run success
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
declare function print(arg:any):string;
|
||||
|
||||
function foo(array, flag) {
|
||||
array.length;
|
||||
if (flag < 0) {
|
||||
array[0]; // only Uint8Array type
|
||||
} else {
|
||||
array[0]; // only Array type
|
||||
}
|
||||
}
|
||||
let a = new Uint8Array([1,2]);
|
||||
let a2 = [1,2,3];
|
||||
foo(a2, 1);
|
||||
foo(a, -1);
|
||||
print("run success");
|
@ -0,0 +1,14 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
run success
|
Loading…
Reference in New Issue
Block a user