brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 527f49a Raw
77 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s3 4; Check that multiple instances of 64-bit constants encodable as5; 32-bit immediates are merged for code size savings.6 7; Immediates with multiple users should not be pulled into instructions when8; optimizing for code size (but 8-bit immediates are exceptions).9 10define i1 @imm_multiple_users(i64 %a, ptr %b) optsize {11; CHECK-LABEL: imm_multiple_users:12; CHECK:       # %bb.0:13; CHECK-NEXT:    movq $-1, (%rsi)14; CHECK-NEXT:    cmpq $-1, %rdi15; CHECK-NEXT:    sete %al16; CHECK-NEXT:    retq17  store i64 -1, ptr %b, align 818  %cmp = icmp eq i64 %a, -119  ret i1 %cmp20}21 22define i1 @imm_multiple_users_pgso(i64 %a, ptr %b) !prof !14 {23; CHECK-LABEL: imm_multiple_users_pgso:24; CHECK:       # %bb.0:25; CHECK-NEXT:    movq $-1, (%rsi)26; CHECK-NEXT:    cmpq $-1, %rdi27; CHECK-NEXT:    sete %al28; CHECK-NEXT:    retq29  store i64 -1, ptr %b, align 830  %cmp = icmp eq i64 %a, -131  ret i1 %cmp32}33 34declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1)35 36; Inlined memsets requiring multiple same-sized stores should be lowered using37; the register, rather than immediate, form of stores when optimizing for38; code size.39define void @memset_zero(ptr noalias nocapture %D) optsize {40; CHECK-LABEL: memset_zero:41; CHECK:       # %bb.0:42; CHECK-NEXT:    xorl %eax, %eax43; CHECK-NEXT:    movq %rax, 7(%rdi)44; CHECK-NEXT:    movq %rax, (%rdi)45; CHECK-NEXT:    retq46  tail call void @llvm.memset.p0.i64(ptr %D, i8 0, i64 15, i1 false)47  ret void48}49 50define void @memset_zero_pgso(ptr noalias nocapture %D) !prof !14 {51; CHECK-LABEL: memset_zero_pgso:52; CHECK:       # %bb.0:53; CHECK-NEXT:    xorl %eax, %eax54; CHECK-NEXT:    movq %rax, 7(%rdi)55; CHECK-NEXT:    movq %rax, (%rdi)56; CHECK-NEXT:    retq57  tail call void @llvm.memset.p0.i64(ptr %D, i8 0, i64 15, i1 false)58  ret void59}60 61!llvm.module.flags = !{!0}62!0 = !{i32 1, !"ProfileSummary", !1}63!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}64!2 = !{!"ProfileFormat", !"InstrProf"}65!3 = !{!"TotalCount", i64 10000}66!4 = !{!"MaxCount", i64 10}67!5 = !{!"MaxInternalCount", i64 1}68!6 = !{!"MaxFunctionCount", i64 1000}69!7 = !{!"NumCounts", i64 3}70!8 = !{!"NumFunctions", i64 3}71!9 = !{!"DetailedSummary", !10}72!10 = !{!11, !12, !13}73!11 = !{i32 10000, i64 100, i32 1}74!12 = !{i32 999000, i64 100, i32 1}75!13 = !{i32 999999, i64 1, i32 2}76!14 = !{!"function_entry_count", i64 0}77