263 lines · plain
1;; Note: The checks for this test are manually generated. Please do not2;; run a script to update these checks.3 4; REQUIRES: asserts5 6; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 \7; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=AIX8; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \9; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=AIX10; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \11; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUX12; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \13; RUN: --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUX14; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \15; RUN: -code-model=large --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE16; RUN: llc -verify-machineinstrs -mtriple powerpc64le-unknown-linux -mcpu=pwr8 \17; RUN: -code-model=large --stats -ppc-min-jump-table-entries=4 < %s 2>&1 | FileCheck %s --check-prefix=LINUXLARGE18 19 20; The purpose of this test is to check that the statistics about the TOC are21; are collected correctly. This test tries to have all of the different types 22; of TOC entries.23 24; AIX: Statistics Collected25; AIX: 1 asmprinter - Number of Block Address TOC Entries.26; AIX: 13 asmprinter - Number of Constant Pool TOC Entries.27; AIX: 1 asmprinter - Number of EH Block TOC Entries.28; AIX: 25 asmprinter - Number of Total TOC Entries Emitted.29; AIX: 3 asmprinter - Number of External Linkage Global TOC Entries.30; AIX: 2 asmprinter - Number of Internal Linkage Global TOC Entries.31; AIX: 1 asmprinter - Number of Jump Table TOC Entries.32; AIX: 4 asmprinter - Number of Thread Local TOC Entries.33 34; LINUX: Statistics Collected35; LINUX: 1 asmprinter - Number of Block Address TOC Entries.36; LINUX: 5 asmprinter - Number of Total TOC Entries Emitted.37; LINUX: 3 asmprinter - Number of External Linkage Global TOC Entries.38; LINUX: 1 asmprinter - Number of Jump Table TOC Entries.39 40; LINUXLARGE: Statistics Collected41; LINUXLARGE: 1 asmprinter - Number of Block Address TOC Entries.42; LINUXLARGE: 13 asmprinter - Number of Constant Pool TOC Entries.43; LINUXLARGE: 20 asmprinter - Number of Total TOC Entries Emitted.44; LINUXLARGE: 3 asmprinter - Number of External Linkage Global TOC Entries.45; LINUXLARGE: 2 asmprinter - Number of Internal Linkage Global TOC Entries.46; LINUXLARGE: 1 asmprinter - Number of Jump Table TOC Entries.47 48 49@gDouble = local_unnamed_addr global double 0.000000e+00, align 850@TLS1 = thread_local global i32 0, align 451@TLS2 = external thread_local global float, align 452@_ZTIi = external constant ptr53@_ZL2G4 = internal unnamed_addr global i32 0, align 454@_ZZ9incrementvE7Element = internal unnamed_addr global i32 0, align 455 56define noundef double @testd1() local_unnamed_addr {57entry:58 ret double 3.784320e+0259}60 61define noundef float @testf1() local_unnamed_addr {62entry:63 ret float 0x40039999A000000064}65 66define noundef double @testd2() local_unnamed_addr {67entry:68 ret double 6.920000e+0069}70 71define noundef <4 x i32> @testv1() local_unnamed_addr {72entry:73 ret <4 x i32> <i32 13, i32 78, i32 -13, i32 100>74}75 76define noundef double @testd3() local_unnamed_addr {77entry:78 %call = tail call noundef double @calleeddf(double noundef 4.582600e+01, double noundef 0x40564F0A3D70A3D7, float noundef 0x402225E360000000)79 ret double %call80}81 82declare noundef double @calleeddf(double noundef, double noundef, float noundef) local_unnamed_addr83 84define noundef i64 @testi() local_unnamed_addr {85entry:86 ret i64 89347191587}88 89define noundef double @testld1() local_unnamed_addr {90entry:91 ret double 0x417179806D5CDEBE92}93 94define noundef signext i32 @testJT(i32 noundef signext %in) {95entry:96 switch i32 %in, label %sw.epilog [97 i32 45, label %return98 i32 86, label %sw.bb199 i32 91, label %sw.bb2100 i32 101, label %sw.bb3101 i32 107, label %sw.bb4102 i32 76832712, label %sw.bb5103 ]104 105sw.bb1: ; preds = %entry106 br label %return107 108sw.bb2: ; preds = %entry109 br label %return110 111sw.bb3: ; preds = %entry112 br label %return113 114sw.bb4: ; preds = %entry115 br label %return116 117sw.bb5: ; preds = %entry118 br label %return119 120sw.epilog: ; preds = %entry121 br label %return122 123return: ; preds = %entry, %sw.epilog, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1124 %retval.0 = phi i32 [ 0, %sw.epilog ], [ 222, %sw.bb5 ], [ 15, %sw.bb4 ], [ 11, %sw.bb3 ], [ 17, %sw.bb2 ], [ 16, %sw.bb1 ], [ 19, %entry ]125 ret i32 %retval.0126}127 128define void @setGDouble(double noundef %a) local_unnamed_addr {129entry:130 store double %a, ptr @gDouble, align 8131 ret void132}133 134define noundef double @getGDouble() local_unnamed_addr {135entry:136 %0 = load double, ptr @gDouble, align 8137 ret double %0138}139 140define noundef signext i32 @testTLS(i32 noundef signext %a, i32 noundef signext %b, ptr nocapture noundef readonly %fIn) {141entry:142 %add = add nsw i32 %b, %a143 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLS1)144 store i32 %add, ptr %0, align 4145 tail call void @calleef(ptr noundef nonnull @testJT)146 %1 = load i32, ptr %0, align 4147 %call = tail call noundef signext i32 %fIn(i32 noundef signext %1)148 %2 = load i32, ptr %0, align 4149 %add1 = add nsw i32 %2, %call150 ret i32 %add1151}152 153define float @getTLS2() local_unnamed_addr {154entry:155 %0 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @TLS2)156 %1 = load float, ptr %0, align 4157 ret float %1158}159 160declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull)161declare void @calleef(ptr noundef) local_unnamed_addr162 163define noundef signext i32 @testEH(i32 noundef signext %i) personality ptr @__xlcxx_personality_v1 {164entry:165 %cmp = icmp slt i32 %i, 1166 br i1 %cmp, label %if.then, label %try.cont167 168if.then: ; preds = %entry169 %exception = tail call ptr @__cxa_allocate_exception(i64 4)170 store i32 10, ptr %exception, align 16171 invoke void @__cxa_throw(ptr nonnull %exception, ptr nonnull @_ZTIi, ptr null)172 to label %unreachable unwind label %lpad173 174lpad: ; preds = %if.then175 %0 = landingpad { ptr, i32 }176 cleanup177 catch ptr @_ZTIi178 %1 = extractvalue { ptr, i32 } %0, 1179 %2 = tail call i32 @llvm.eh.typeid.for(ptr nonnull @_ZTIi)180 %matches = icmp eq i32 %1, %2181 br i1 %matches, label %catch, label %ehcleanup182 183catch: ; preds = %lpad184 %3 = extractvalue { ptr, i32 } %0, 0185 %4 = tail call ptr @__cxa_begin_catch(ptr %3)186 tail call void @__cxa_end_catch()187 br label %try.cont188 189try.cont: ; preds = %entry, %catch190 %ret.0 = phi i32 [ 1, %catch ], [ 0, %entry ]191 ret i32 %ret.0192 193ehcleanup: ; preds = %lpad194 resume { ptr, i32 } %0195 196unreachable: ; preds = %if.then197 unreachable198}199 200declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr201declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr202declare i32 @__xlcxx_personality_v1(...)203declare i32 @llvm.eh.typeid.for(ptr)204declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr205declare void @__cxa_end_catch() local_unnamed_addr206 207define noundef double @testISel1(i32 noundef signext %i) {208entry:209 %cmp = icmp slt i32 %i, 0210 %cmp1.not = icmp eq i32 %i, 0211 %. = select i1 %cmp1.not, double 1.618030e+00, double 2.718280e+00212 %retval.0 = select i1 %cmp, double 3.141590e+00, double %.213 ret double %retval.0214}215 216define noundef double @testISel2(i32 noundef signext %i) {217entry:218 %cmp = icmp slt i32 %i, 0219 br i1 %cmp, label %return, label %if.else220 221if.else: ; preds = %entry222 %cmp1 = icmp ugt i32 %i, 30223 br i1 %cmp1, label %return, label %if.else3224 225if.else3: ; preds = %if.else226 %cmp4 = icmp ugt i32 %i, 5227 %. = select i1 %cmp4, double 8.644600e+00, double 1.618030e+00228 br label %return229 230return: ; preds = %if.else3, %if.else, %entry231 %retval.0 = phi double [ 3.141590e+00, %entry ], [ 2.718280e+00, %if.else ], [ %., %if.else3 ]232 ret double %retval.0233}234 235 236define ptr @testBlockAddr() {237entry:238 br label %here239 240here:241 ret ptr blockaddress(@testBlockAddr, %here)242}243 244define noundef signext i32 @_Z5getG4v() local_unnamed_addr {245entry:246 %0 = load i32, ptr @_ZL2G4, align 4247 ret i32 %0248}249 250define void @_Z5setG4i(i32 noundef signext %value) local_unnamed_addr {251entry:252 store i32 %value, ptr @_ZL2G4, align 4253 ret void254}255 256define noundef signext i32 @_Z9incrementv() local_unnamed_addr {257entry:258 %0 = load i32, ptr @_ZZ9incrementvE7Element, align 4259 %inc = add nsw i32 %0, 1260 store i32 %inc, ptr @_ZZ9incrementvE7Element, align 4261 ret i32 %inc262}263