brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · f184e04 Raw
29 lines · plain
1; Intrinsic calls can't be uniformly replaced with undef without invalidating2; IR (eg: only intrinsic calls can have metadata arguments), so ensure they are3; not replaced. The whole call instruction can be removed by instruction4; reduction instead.5 6; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=functions,instructions --test FileCheck --test-arg --check-prefixes=ALL,CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t 2> %t.log7; RUN: FileCheck -implicit-check-not=uninteresting --check-prefixes=ALL,CHECK-FINAL %s < %t8 9; Check that the call is removed by instruction reduction passes10; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=functions,instructions --test FileCheck --test-arg --check-prefix=ALL --test-arg %s --test-arg --input-file %s -o %t11; RUN: FileCheck -implicit-check-not=uninteresting --check-prefixes=ALL,CHECK-NOCALL %s < %t12 13 14declare ptr @llvm.sponentry.p0()15declare i8 @uninteresting()16 17; ALL-LABEL: define ptr @interesting(18define ptr @interesting() {19entry:20  ; CHECK-INTERESTINGNESS: call ptr21  ; CHECK-NOCALL-NOT: call i822 23  ; CHECK-FINAL: %call = call ptr @llvm.sponentry.p0()24  ; CHECK-FINAL-NEXT: ret ptr %call25  %call = call ptr @llvm.sponentry.p0()26  call i8 @uninteresting()27  ret ptr %call28}29