brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 4074fcb Raw
53 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals2; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-annotate-decl-cs  -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT3; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC4target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"5 6; Checks if !prof metadata is corret in deadargelim.7 8define void @caller() #0 {9; TUNIT-LABEL: define {{[^@]+}}@caller() {10; TUNIT-NEXT:    [[X:%.*]] = alloca i32, align 411; TUNIT-NEXT:    store i32 42, ptr [[X]], align 412; TUNIT-NEXT:    [[TMP1:%.*]] = load i32, ptr [[X]], align 413; TUNIT-NEXT:    call void @promote_i32_ptr(i32 [[TMP1]]), !prof [[PROF0:![0-9]+]]14; TUNIT-NEXT:    ret void15;16; CGSCC-LABEL: define {{[^@]+}}@caller() {17; CGSCC-NEXT:    call void @promote_i32_ptr(i32 noundef 42), !prof [[PROF0:![0-9]+]]18; CGSCC-NEXT:    ret void19;20  %x = alloca i3221  store i32 42, ptr %x22  call void @promote_i32_ptr(ptr %x), !prof !023  ret void24}25 26define internal void @promote_i32_ptr(ptr %xp) {27; CHECK: Function Attrs: memory(readwrite, argmem: none)28; CHECK-LABEL: define {{[^@]+}}@promote_i32_ptr29; CHECK-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {30; CHECK-NEXT:    [[XP_PRIV:%.*]] = alloca i32, align 431; CHECK-NEXT:    store i32 [[TMP0]], ptr [[XP_PRIV]], align 432; CHECK-NEXT:    [[X:%.*]] = load i32, ptr [[XP_PRIV]], align 433; CHECK-NEXT:    call void @use_i32(i32 [[X]])34; CHECK-NEXT:    ret void35;36  %x = load i32, ptr %xp37  call void @use_i32(i32 %x)38  ret void39}40 41declare void @use_i32(i32)42 43!0 = !{!"branch_weights", i32 30}44;.45; TUNIT: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) }46;.47; CGSCC: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) }48;.49; TUNIT: [[PROF0]] = !{!"branch_weights", i32 30}50;.51; CGSCC: [[PROF0]] = !{!"branch_weights", i32 30}52;.53