mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 08:06:06 +00:00

Reduce by calling the resolver function at the use site, and inserting an indirect call. Try to delete if there are no uses left over. We should also probably try to do something about constantexpr uses; perhaps treat them like aliases.
23 lines
810 B
LLVM
23 lines
810 B
LLVM
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=ifuncs --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
|
|
; RUN: FileCheck --check-prefixes=CHECK-FINAL --input-file=%t %s
|
|
|
|
; Check some cases that should probably be invalid IR don't break
|
|
; anything.
|
|
|
|
; CHECK-FINAL: @ifunc_with_arg = ifunc void (), ptr @resolver_with_arg
|
|
@ifunc_with_arg = ifunc void (), ptr @resolver_with_arg
|
|
|
|
define ptr @resolver_with_arg(i64 %arg) {
|
|
%cast = inttoptr i64 %arg to ptr
|
|
ret ptr %cast
|
|
}
|
|
|
|
; CHECK-INTERESTINGNESS: define void @call_with_arg()
|
|
define void @call_with_arg() {
|
|
; CHECK-FINAL: define void @call_with_arg() {
|
|
; CHECK-FINAL-NEXT: call void @ifunc_with_arg()
|
|
; CHECK-FINAL-NEXT: ret void
|
|
call void @ifunc_with_arg()
|
|
ret void
|
|
}
|