[bpf] allow direct and indirect calls
kernel verifier is becoming smarter and soon will support
direct and indirect function calls.
Remove obsolete error from BPF backend.
Make call to use PCRel_4 fixup.
'bpf to bpf' calls are distinguished from 'bpf to kernel' calls
by insn->src_reg == BPF_PSEUDO_CALL == 1 which is used as relocation
indicator similar to ld_imm64->src_reg == BPF_PSEUDO_MAP_FD == 1
The actual 'call' instruction remains the same for both
'bpf to kernel' and 'bpf to bpf' calls.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318614
diff --git a/llvm/test/CodeGen/BPF/cc_args.ll b/llvm/test/CodeGen/BPF/cc_args.ll
index 6a0a07a..020992a 100644
--- a/llvm/test/CodeGen/BPF/cc_args.ll
+++ b/llvm/test/CodeGen/BPF/cc_args.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
define void @test() #0 {
entry:
diff --git a/llvm/test/CodeGen/BPF/cc_args_be.ll b/llvm/test/CodeGen/BPF/cc_args_be.ll
index a2f1956..469556f 100644
--- a/llvm/test/CodeGen/BPF/cc_args_be.ll
+++ b/llvm/test/CodeGen/BPF/cc_args_be.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
; test big endian
define void @test() #0 {
diff --git a/llvm/test/CodeGen/BPF/cc_ret.ll b/llvm/test/CodeGen/BPF/cc_ret.ll
index be198f5..73e3556 100644
--- a/llvm/test/CodeGen/BPF/cc_ret.ll
+++ b/llvm/test/CodeGen/BPF/cc_ret.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel | FileCheck %s
define void @test() #0 {
entry:
diff --git a/llvm/test/CodeGen/BPF/fi_ri.ll b/llvm/test/CodeGen/BPF/fi_ri.ll
index 6ecc826..1245298 100644
--- a/llvm/test/CodeGen/BPF/fi_ri.ll
+++ b/llvm/test/CodeGen/BPF/fi_ri.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpf | FileCheck %s
+; RUN: llc < %s -march=bpf | FileCheck %s
%struct.key_t = type { i32, [16 x i8] }
diff --git a/llvm/test/CodeGen/BPF/sanity.ll b/llvm/test/CodeGen/BPF/sanity.ll
index ebee851..33cfc2f 100644
--- a/llvm/test/CodeGen/BPF/sanity.ll
+++ b/llvm/test/CodeGen/BPF/sanity.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel | FileCheck %s
@foo_printf.fmt = private unnamed_addr constant [9 x i8] c"hello \0A\00", align 1
diff --git a/llvm/test/CodeGen/BPF/undef.ll b/llvm/test/CodeGen/BPF/undef.ll
index 6b99486..11bc9eb 100644
--- a/llvm/test/CodeGen/BPF/undef.ll
+++ b/llvm/test/CodeGen/BPF/undef.ll
@@ -1,5 +1,5 @@
-; RUN: not llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK,EL %s
-; RUN: not llc < %s -march=bpfeb | FileCheck -check-prefixes=CHECK,EB %s
+; RUN: llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK,EL %s
+; RUN: llc < %s -march=bpfeb | FileCheck -check-prefixes=CHECK,EB %s
%struct.bpf_map_def = type { i32, i32, i32, i32 }
%struct.__sk_buff = type opaque
diff --git a/llvm/test/CodeGen/BPF/warn-call.ll b/llvm/test/CodeGen/BPF/warn-call.ll
index ae7f78a..6dadb35 100644
--- a/llvm/test/CodeGen/BPF/warn-call.ll
+++ b/llvm/test/CodeGen/BPF/warn-call.ll
@@ -2,9 +2,6 @@
; CHECK: error: warn_call.c
; CHECK: built-in function 'memcpy'
-; CHECK: error: warn_call.c
-; CHECK: global function 'foo'
-; CHECK: global function 'bar'
define i8* @warn(i8* returned, i8*, i64) local_unnamed_addr #0 !dbg !6 {
tail call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !14, metadata !17), !dbg !18
tail call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !15, metadata !17), !dbg !19