summaryrefslogtreecommitdiff
path: root/test/CodeGen/BPF
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2017-09-11 23:43:35 +0000
committerYonghong Song <yhs@fb.com>2017-09-11 23:43:35 +0000
commit9e8c499282cc91a60fd74a5279a123a478c93845 (patch)
tree7ce4556c8ab1abca81a64f8e82c06aedb073943f /test/CodeGen/BPF
parent3b0f60ebdc8c9d66c8b6cb7f4c276af088d1fed7 (diff)
bpf: add " ll" in the LD_IMM64 asmstring
This partially revert previous fix in commit f5858045aa0b ("bpf: proper print imm64 expression in inst printer"). In that commit, the original suffix "ll" is removed from LD_IMM64 asmstring. In the customer print method, the "ll" suffix is printed if the rhs is an immediate. For example, "r2 = 5ll" => "r2 = 5ll", and "r3 = varll" => "r3 = var". This has an issue though for assembler. Since assembler relies on asmstring to do pattern matching, it will not be able to distiguish between "mov r2, 5" and "ld_imm64 r2, 5" since both asmstring is "r2 = 5". In such cases, the assembler uses 64bit load for all "r = <val>" asm insts. This patch adds back " ll" suffix for ld_imm64 with one additional space for "#reg = #global_var" case. Signed-off-by: Yonghong Song <yhs@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/BPF')
-rw-r--r--test/CodeGen/BPF/cc_args.ll4
-rw-r--r--test/CodeGen/BPF/cc_args_be.ll4
-rw-r--r--test/CodeGen/BPF/cc_ret.ll2
-rw-r--r--test/CodeGen/BPF/ex1.ll2
-rw-r--r--test/CodeGen/BPF/intrinsics.ll2
-rw-r--r--test/CodeGen/BPF/mem_offset_be.ll2
-rw-r--r--test/CodeGen/BPF/sanity.ll2
7 files changed, 9 insertions, 9 deletions
diff --git a/test/CodeGen/BPF/cc_args.ll b/test/CodeGen/BPF/cc_args.ll
index a2ac03f0da1..6a0a07ae8e8 100644
--- a/test/CodeGen/BPF/cc_args.ll
+++ b/test/CodeGen/BPF/cc_args.ll
@@ -12,7 +12,7 @@ entry:
; CHECK: call f_i32
call void @f_i32(i32 12345678)
-; CHECK: r1 = 72623859790382856ll # encoding: [0x18,0x01,0x00,0x00,0x08,0x07,0x06,0x05,0x00,0x00,0x00,0x00,0x04,0x03,0x02,0x01]
+; CHECK: r1 = 72623859790382856 ll # encoding: [0x18,0x01,0x00,0x00,0x08,0x07,0x06,0x05,0x00,0x00,0x00,0x00,0x04,0x03,0x02,0x01]
; CHECK: call f_i64
call void @f_i64(i64 72623859790382856)
@@ -28,7 +28,7 @@ entry:
call void @f_i16_i32_i16(i16 2, i32 3, i16 4)
; CHECK: r1 = 5
-; CHECK: r2 = 7262385979038285ll
+; CHECK: r2 = 7262385979038285 ll
; CHECK: r3 = 6
; CHECK: call f_i16_i64_i16
call void @f_i16_i64_i16(i16 5, i64 7262385979038285, i16 6)
diff --git a/test/CodeGen/BPF/cc_args_be.ll b/test/CodeGen/BPF/cc_args_be.ll
index dc41ee0d8a7..a2f1956319e 100644
--- a/test/CodeGen/BPF/cc_args_be.ll
+++ b/test/CodeGen/BPF/cc_args_be.ll
@@ -13,7 +13,7 @@ entry:
; CHECK: call f_i32
call void @f_i32(i32 12345678)
-; CHECK: r1 = 72623859790382856ll # encoding: [0x18,0x10,0x00,0x00,0x05,0x06,0x07,0x08,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04]
+; CHECK: r1 = 72623859790382856 ll # encoding: [0x18,0x10,0x00,0x00,0x05,0x06,0x07,0x08,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04]
; CHECK: call f_i64
call void @f_i64(i64 72623859790382856)
@@ -29,7 +29,7 @@ entry:
call void @f_i16_i32_i16(i16 2, i32 3, i16 4)
; CHECK: r1 = 5
-; CHECK: r2 = 7262385979038285ll
+; CHECK: r2 = 7262385979038285 ll
; CHECK: r3 = 6
; CHECK: call f_i16_i64_i16
call void @f_i16_i64_i16(i16 5, i64 7262385979038285, i16 6)
diff --git a/test/CodeGen/BPF/cc_ret.ll b/test/CodeGen/BPF/cc_ret.ll
index eab2a359b8f..be198f5d15f 100644
--- a/test/CodeGen/BPF/cc_ret.ll
+++ b/test/CodeGen/BPF/cc_ret.ll
@@ -42,7 +42,7 @@ define i32 @f_i32() #0 {
define i64 @f_i64() #0 {
; CHECK: f_i64:
-; CHECK: r0 = 72623859790382856ll
+; CHECK: r0 = 72623859790382856 ll
; CHECK: exit
ret i64 72623859790382856
}
diff --git a/test/CodeGen/BPF/ex1.ll b/test/CodeGen/BPF/ex1.ll
index 2f77884f5ef..97cc7e07ab9 100644
--- a/test/CodeGen/BPF/ex1.ll
+++ b/test/CodeGen/BPF/ex1.ll
@@ -32,7 +32,7 @@ define i32 @bpf_prog1(%struct.bpf_context* nocapture %ctx) #0 section "events/ne
; CHECK: call 9
; CHECK: if r0 != 0
; CHECK: r1 = 622884453
-; CHECK: r1 = 7214898703899978611ll
+; CHECK: r1 = 7214898703899978611 ll
; CHECK: call 11
; CHECK: r0 = 0
; CHECK: exit
diff --git a/test/CodeGen/BPF/intrinsics.ll b/test/CodeGen/BPF/intrinsics.ll
index 18d14a08fd9..88aba805ada 100644
--- a/test/CodeGen/BPF/intrinsics.ll
+++ b/test/CodeGen/BPF/intrinsics.ll
@@ -55,7 +55,7 @@ entry:
tail call void inttoptr (i64 4 to void (i64, i32)*)(i64 %call, i32 4) #2
ret i32 0
; CHECK-LABEL: ld_pseudo:
-; CHECK: ld_pseudo r1, 2, 3ll # encoding: [0x18,0x21,0x00,0x00,0x03,0x00
+; CHECK: ld_pseudo r1, 2, 3 # encoding: [0x18,0x21,0x00,0x00,0x03,0x00
}
declare i64 @llvm.bpf.pseudo(i64, i64) #2
diff --git a/test/CodeGen/BPF/mem_offset_be.ll b/test/CodeGen/BPF/mem_offset_be.ll
index e5e352783d7..7d7243a6667 100644
--- a/test/CodeGen/BPF/mem_offset_be.ll
+++ b/test/CodeGen/BPF/mem_offset_be.ll
@@ -2,7 +2,7 @@
; Function Attrs: nounwind
define i32 @bpf_prog1(i8* nocapture readnone) local_unnamed_addr #0 {
-; CHECK: r1 = 590618314553ll # encoding: [0x18,0x10,0x00,0x00,0x83,0x98,0x47,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89]
+; CHECK: r1 = 590618314553 ll # encoding: [0x18,0x10,0x00,0x00,0x83,0x98,0x47,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89]
; CHECK: r1 += -1879113726 # encoding: [0x07,0x10,0x00,0x00,0x8f,0xff,0x00,0x02]
; CHECK: r0 = *(u64 *)(r1 + 0) # encoding: [0x79,0x01,0x00,0x00,0x00,0x00,0x00,0x00]
%2 = alloca i64, align 8
diff --git a/test/CodeGen/BPF/sanity.ll b/test/CodeGen/BPF/sanity.ll
index a7aed65b821..ebee851fbfb 100644
--- a/test/CodeGen/BPF/sanity.ll
+++ b/test/CodeGen/BPF/sanity.ll
@@ -105,7 +105,7 @@ define void @foo_printf() #1 {
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %fmt, i64 0, i64 0
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @foo_printf.fmt, i64 0, i64 0), i64 9, i32 1, i1 false)
; CHECK-LABEL: foo_printf:
-; CHECK: r1 = 729618802566522216ll
+; CHECK: r1 = 729618802566522216 ll
%2 = call i32 (i8*, ...) @printf(i8* %1) #3
ret void
}