brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.0 KiB · e03fc1c Raw
113 lines · plain
1; REQUIRES: asserts2; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes=inline -inline-cost-full=true -inline-threshold=0 -inline-instr-cost=5 -inline-call-penalty=0 -debug-only=inline < %s 2>&1 | FileCheck %s3 4; CHECK:      NOT Inlining (cost={{[0-9]+}}, threshold={{[0-9]+}}), Call:   %noinlinecall1 = call noundef i64 @non_inlining_call5; CHECK:      NOT Inlining (cost={{[0-9]+}}, threshold={{[0-9]+}}), Call:   %noinlinecall2 = call noundef i64 @non_inlining_call6; CHECK-NOT:  NOT Inlining (cost={{[0-9]+}}, threshold={{[0-9]+}}), Call:   %inlinecall1 = call noundef i64 @inlining_call7; CHECK-NOT:  NOT Inlining (cost={{[0-9]+}}, threshold={{[0-9]+}}), Call:   %inlinecall2 = call noundef i64 @inlining_call8 9define noundef i64 @non_inlining_call(ptr noundef %ptra0, ptr noundef %ptrb0, ptr noundef %ptrc0, ptr noundef %ptrd0, ptr noundef %ptre0, ptr noundef %ptrf0, ptr noundef %ptrg0, ptr noundef %ptrh0, ptr noundef %ptri0, ptr noundef %ptrj0, ptr noundef %ptrk0, ptr noundef %ptrl0, ptr noundef %ptrm0, ptr noundef %ptrn0, ptr noundef %ptro0, ptr noundef %ptrp0) {10entry:11  %a0 = load i64, ptr %ptra0, align 812  %b0 = load i64, ptr %ptrb0, align 813  %c0 = load i64, ptr %ptrc0, align 814  %d0 = load i64, ptr %ptrd0, align 815  %e0 = load i64, ptr %ptre0, align 816  %f0 = load i64, ptr %ptrf0, align 817  %g0 = load i64, ptr %ptrg0, align 818  %h0 = load i64, ptr %ptrh0, align 819  %i0 = load i64, ptr %ptri0, align 820  %j0 = load i64, ptr %ptrj0, align 821  %k0 = load i64, ptr %ptrk0, align 822  %l0 = load i64, ptr %ptrl0, align 823  %m0 = load i64, ptr %ptrm0, align 824  %n0 = load i64, ptr %ptrn0, align 825  %o0 = load i64, ptr %ptro0, align 826  %p0 = load i64, ptr %ptrp0, align 827  %xor = xor i64 %a0, %b028  %xor1 = xor i64 %xor, %c029  %xor2 = xor i64 %xor1, %d030  %xor3 = xor i64 %xor2, %e031  %xor4 = xor i64 %xor3, %f032  %xor5 = xor i64 %xor4, %g033  %xor6 = xor i64 %xor5, %h034  %xor7 = xor i64 %xor6, %i035  %xor8 = xor i64 %xor7, %j036  %xor9 = xor i64 %xor8, %k037  %xor10 = xor i64 %xor9, %l038  %xor11 = xor i64 %xor10, %m039  %xor12 = xor i64 %xor11, %n040  %xor13 = xor i64 %xor12, %o041  %xor14 = xor i64 %xor13, %p042  ret i64 %xor1443}44 45define noundef i64 @inlining_call(ptr noundef %ptra0, ptr noundef %ptrb0, ptr noundef %ptrc0, ptr noundef %ptrd0, ptr noundef %ptre0, ptr noundef %ptrf0, ptr noundef %ptrg0, ptr noundef %ptrh0, ptr noundef %ptri0, ptr noundef %ptrj0, ptr noundef %ptrk0, ptr noundef %ptrl0, ptr noundef %ptrm0, ptr noundef %ptrn0, ptr noundef %ptro0, ptr noundef %ptrp0, ptr noundef %ptrq0) {46entry:47  %a0 = load i64, ptr %ptra0, align 848  %b0 = load i64, ptr %ptrb0, align 849  %c0 = load i64, ptr %ptrc0, align 850  %d0 = load i64, ptr %ptrd0, align 851  %e0 = load i64, ptr %ptre0, align 852  %f0 = load i64, ptr %ptrf0, align 853  %g0 = load i64, ptr %ptrg0, align 854  %h0 = load i64, ptr %ptrh0, align 855  %i0 = load i64, ptr %ptri0, align 856  %j0 = load i64, ptr %ptrj0, align 857  %k0 = load i64, ptr %ptrk0, align 858  %l0 = load i64, ptr %ptrl0, align 859  %m0 = load i64, ptr %ptrm0, align 860  %n0 = load i64, ptr %ptrn0, align 861  %o0 = load i64, ptr %ptro0, align 862  %p0 = load i64, ptr %ptrp0, align 863  %q0 = load i64, ptr %ptrq0, align 864  %xor = xor i64 %a0, %b065  %xor1 = xor i64 %xor, %c066  %xor2 = xor i64 %xor1, %d067  %xor3 = xor i64 %xor2, %e068  %xor4 = xor i64 %xor3, %f069  %xor5 = xor i64 %xor4, %g070  %xor6 = xor i64 %xor5, %h071  %xor7 = xor i64 %xor6, %i072  %xor8 = xor i64 %xor7, %j073  %xor9 = xor i64 %xor8, %k074  %xor10 = xor i64 %xor9, %l075  %xor11 = xor i64 %xor10, %m076  %xor12 = xor i64 %xor11, %n077  %xor13 = xor i64 %xor12, %o078  %xor14 = xor i64 %xor13, %p079  %xor15 = xor i64 %xor14, %q080  ret i64 %xor1581}82 83; Calling each (non-)inlining function twice to make sure they won't get the sole call inlining cost bonus. 84define i64 @Caller(ptr noundef %in) {85entry:86  %a0 = getelementptr inbounds i64, ptr %in, i64 087  %b0 = getelementptr inbounds i64, ptr %in, i64 188  %c0 = getelementptr inbounds i64, ptr %in, i64 289  %d0 = getelementptr inbounds i64, ptr %in, i64 390  %e0 = getelementptr inbounds i64, ptr %in, i64 491  %f0 = getelementptr inbounds i64, ptr %in, i64 592  %g0 = getelementptr inbounds i64, ptr %in, i64 693  %h0 = getelementptr inbounds i64, ptr %in, i64 794  %i0 = getelementptr inbounds i64, ptr %in, i64 895  %j0 = getelementptr inbounds i64, ptr %in, i64 996  %k0 = getelementptr inbounds i64, ptr %in, i64 1097  %l0 = getelementptr inbounds i64, ptr %in, i64 1198  %m0 = getelementptr inbounds i64, ptr %in, i64 1299  %n0 = getelementptr inbounds i64, ptr %in, i64 13100  %o0 = getelementptr inbounds i64, ptr %in, i64 14101  %p0 = getelementptr inbounds i64, ptr %in, i64 15102  %q0 = getelementptr inbounds i64, ptr %in, i64 16103  %noinlinecall1 = call noundef i64 @non_inlining_call(ptr noundef %a0, ptr noundef %b0, ptr noundef %c0, ptr noundef %d0, ptr noundef %e0, ptr noundef %f0, ptr noundef %g0, ptr noundef %h0, ptr noundef %i0, ptr noundef %j0, ptr noundef %k0, ptr noundef %l0, ptr noundef %m0, ptr noundef %n0, ptr noundef %o0, ptr noundef %p0)104  %add = add i64 0, %noinlinecall1105  %noinlinecall2 = call noundef i64 @non_inlining_call(ptr noundef %a0, ptr noundef %b0, ptr noundef %c0, ptr noundef %d0, ptr noundef %e0, ptr noundef %f0, ptr noundef %g0, ptr noundef %h0, ptr noundef %i0, ptr noundef %j0, ptr noundef %k0, ptr noundef %l0, ptr noundef %m0, ptr noundef %n0, ptr noundef %o0, ptr noundef %p0)106  %add2 = add i64 %add, %noinlinecall2107  %inlinecall1 = call noundef i64 @inlining_call(ptr noundef %a0, ptr noundef %b0, ptr noundef %c0, ptr noundef %d0, ptr noundef %e0, ptr noundef %f0, ptr noundef %g0, ptr noundef %h0, ptr noundef %i0, ptr noundef %j0, ptr noundef %k0, ptr noundef %l0, ptr noundef %m0, ptr noundef %n0, ptr noundef %o0, ptr noundef %p0, ptr noundef %q0)108  %add3 = add i64 %add2, %inlinecall1109  %inlinecall2 = call noundef i64 @inlining_call(ptr noundef %a0, ptr noundef %b0, ptr noundef %c0, ptr noundef %d0, ptr noundef %e0, ptr noundef %f0, ptr noundef %g0, ptr noundef %h0, ptr noundef %i0, ptr noundef %j0, ptr noundef %k0, ptr noundef %l0, ptr noundef %m0, ptr noundef %n0, ptr noundef %o0, ptr noundef %p0, ptr noundef %q0)110  %add4 = add i64 %add3, %inlinecall2111  ret i64 %add4112}113