# Copyright (c) 2021-2022 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. .record A { A a } .function i32 foo_i() .function i32 foo_iA(A a0) .function A foo_AA(A a0) #! CHECKER Definition with phi input in the same block #! RUN_LLVM options: "--compiler-regex=_GLOBAL::liveness_0 \ #! --llvm-gc-check=true --llvm-dump-after" #! READ_FILE "console.out" #! INST /%v5[0-9]* = phi ptr addrspace\(271\).* \[ %v9[0-9]*.rel.*, .* \]/ .function i32 liveness_0() { newobj v0, A backedge: call foo_AA, v0 # the definition and the phi input are in the same block sta.obj v0 call foo_i # a statepoint jeqz backedge return exit: ldai 42 return } #! CHECKER Do not propagate null value as a phi input #! RUN_LLVM options: "--compiler-regex=_GLOBAL::liveness_1 \ #! --llvm-gc-check=true --llvm-dump-after" #! READ_FILE "console.out" #! INST_NOT "(null, null)" .function i32 liveness_1() { newobj v0, A backedge: call foo_iA, v0 mov.null v0 jeqz backedge return }