brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 54f4262 Raw
46 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=throughput   -mcpu=corei7-avx | FileCheck %s --check-prefix=THRU3; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=latency      -mcpu=corei7-avx | FileCheck %s --check-prefix=LATE4; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size    -mcpu=corei7-avx | FileCheck %s --check-prefix=SIZE5; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mcpu=corei7-avx | FileCheck %s --check-prefix=SIZE_LATE6 7define void @test_geps() {8; THRU-LABEL: 'test_geps'9; THRU-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 922337203685477580710; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 29514790517935282585511; THRU-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void12;13; LATE-LABEL: 'test_geps'14; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 922337203685477580715; LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 29514790517935282585516; LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void17;18; SIZE-LABEL: 'test_geps'19; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 922337203685477580720; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 29514790517935282585521; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void22;23; SIZE_LATE-LABEL: 'test_geps'24; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 922337203685477580725; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 29514790517935282585526; SIZE_LATE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void27;28 29  ; Cost of scalar geps should be zero.30  ; We expect it to be folded into the instruction addressing mode.31 32 33  ; Vector geps should also have zero cost.34 35  ; Check that we handle outlandishly large GEPs properly.  This is unlikely to36  ; be a valid pointer, but LLVM still generates GEPs like this sometimes in37  ; dead code.38  ; This GEP has index INT64_MAX, which is cost 1.39  %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 922337203685477580740 41  ; This GEP index wraps around to -1, which is cost 0.42  %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 29514790517935282585543 44  ret void45}46