brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 489c315 Raw
59 lines · plain
1; RUN: opt < %s -mtriple=x86_64-unknown-linux -passes=pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s2; RUN: opt < %s -mtriple=x86_64-pc-win32-coff -passes=pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s3 4; Rename Comdat group and its function.5$f = comdat any6; CHECK: $f.[[SINGLEBB_HASH:[0-9]+]] = comdat any7define linkonce_odr void @f() comdat($f) {8  ret void9}10 11; Not rename Comdat with an alias (an alias is an address-taken user).12$f_with_alias = comdat any13; CHECK: $f_with_alias = comdat any14define linkonce_odr void @f_with_alias() comdat {15  ret void16}17@f_alias = alias void (), ptr @f_with_alias18 19; Not rename Comdat with right linkage.20$nf = comdat any21; CHECK: $nf = comdat any22define void @nf() comdat($nf) {23  ret void24}25 26; Not rename Comdat with variable members.27$f_with_var = comdat any28; CHECK: $f_with_var = comdat any29@var = global i32 0, comdat($f_with_var)30define linkonce_odr void @f_with_var() comdat($f_with_var) {31  %tmp = load i32, ptr @var, align 432  %inc = add nsw i32 %tmp, 133  store i32 %inc, ptr @var, align 434  ret void35}36 37; Not rename Comdat with multiple functions.38$tf = comdat any39; CHECK: $tf = comdat any40define linkonce void @tf() comdat($tf) {41  ret void42}43define linkonce void @tf2() comdat($tf) {44  ret void45}46 47; Rename AvailableExternallyLinkage functions48; CHECK-DAG: $aef.[[SINGLEBB_HASH]] = comdat any49 50; CHECK: @f = weak alias void (), ptr @f.[[SINGLEBB_HASH]]51; CHECK: @aef = weak alias void (), ptr @aef.[[SINGLEBB_HASH]]52 53define available_externally void @aef() {54; CHECK: define linkonce_odr void @aef.[[SINGLEBB_HASH]]() comdat {55  ret void56}57 58 59