Skip to content

Commit 8fcbb0a

Browse files
author
Yonghong Song
committed
[BPF] Make -mcpu=v3 as the default
Before llvm20, (void)__sync_fetch_and_add(...) always generates locked xadd insns. In linux kernel upstream discussion [1], it is found that for arm64 architecture, the original semantics of (void)__sync_fetch_and_add(...), i.e., __atomic_fetch_add(...), is preferred in order for jit to emit proper native barrier insns. In llvm commits [2] and [3], (void)__sync_fetch_and_add(...) will generate the following insns: - for cpu v1/v2: locked xadd insns to keep backward compatibility - for cpu v3/v4: __atomic_fetch_add() insns To ensure proper barrier semantics for (void)__sync_fetch_and_add(...), cpu v3/v4 is recommended. This patch enables cpu=v3 as the default cpu version. For users wanting to use cpu v1, -mcpu=v1 needs to be explicitly added to clang/llc command line. [1] https://lore.kernel.org/bpf/[email protected]/T/#mb68d67bc8f39e35a0c3db52468b9de59b79f021f [2] #101428 [3] #106494
1 parent 4a505e1 commit 8fcbb0a

File tree

81 files changed

+137
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+137
-131
lines changed

clang/lib/Basic/Targets/BPF.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,22 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts,
3838

3939
Builder.defineMacro("__BPF_FEATURE_ADDR_SPACE_CAST");
4040

41-
if (CPU.empty() || CPU == "generic" || CPU == "v1") {
41+
if (CPU == "generic" || CPU == "v1") {
4242
Builder.defineMacro("__BPF_CPU_VERSION__", "1");
4343
return;
4444
}
4545

46-
std::string CpuVerNumStr = CPU.substr(1);
47-
Builder.defineMacro("__BPF_CPU_VERSION__", CpuVerNumStr);
46+
int CpuVerNum;
47+
if (CPU.empty()) {
48+
Builder.defineMacro("__BPF_CPU_VERSION__", "3");
49+
CpuVerNum = 3;
50+
} else {
51+
std::string CpuVerNumStr = CPU.substr(1);
52+
Builder.defineMacro("__BPF_CPU_VERSION__", CpuVerNumStr);
53+
CpuVerNum = std::stoi(CpuVerNumStr);
54+
}
4855
Builder.defineMacro("__BPF_FEATURE_MAY_GOTO");
4956

50-
int CpuVerNum = std::stoi(CpuVerNumStr);
5157
if (CpuVerNum >= 2)
5258
Builder.defineMacro("__BPF_FEATURE_JMP_EXT");
5359

clang/test/Preprocessor/bpf-predefined-macros.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang -E -target bpfel -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
2-
// RUN: %clang -E -target bpfeb -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
1+
// RUN: %clang -E -target bpfel -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
2+
// RUN: %clang -E -target bpfeb -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
33
// RUN: %clang -E -target bpfel -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V1 %s
44
// RUN: %clang -E -target bpfel -mcpu=v2 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V2 %s
55
// RUN: %clang -E -target bpfel -mcpu=v3 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V3 %s

llvm/lib/Target/BPF/BPFSubtarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
7373
HasJmpExt = true;
7474
return;
7575
}
76-
if (CPU == "v3") {
76+
if (CPU.empty() || CPU == "v3") {
7777
HasJmpExt = true;
7878
HasJmp32 = true;
7979
HasAlu32 = true;

llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -O2 -march=bpfel -mattr=+alu32 < %s | FileCheck %s
1+
; RUN: llc -O2 -march=bpfel -mcpu=v1 -mattr=+alu32 < %s | FileCheck %s
22
;
33
; unsigned int select_cc_32 (unsigned a, unsigned b, int c, int d)
44
; {

llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2-
; RUN: opt -O2 -S < %s | llc -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: opt -O2 -S < %s | llc -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: opt -O2 -S < %s | llc -mcpu=v1 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: opt -O2 -S < %s | llc -mcpu=v1 -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; struct s {
66
; unsigned long long f1;

llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2-
; RUN: opt -O2 -S < %s | llc -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: opt -O2 -S < %s | llc -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: opt -O2 -S < %s | llc -mcpu=v1 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: opt -O2 -S < %s | llc -mcpu=v1 -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; struct s {
66
; unsigned long long f1;

llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
44
; Source code:
55
; struct s {
66
; char f1;

llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
44
; Source code:
55
; struct s {
66
; char f1;

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1; char a2; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1[10][10]; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef unsigned __uint;
66
; struct s1 { int a1; __uint a2:9; __uint a3:4; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef unsigned __uint;
66
; struct s1 { int a1; __uint a2:9; __uint a3:4; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1[10][10]; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1; short a2; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { int a1; char a2; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef struct s1 { char a1 [5][5]; } __s1;
66
; union u1 { int b1; __s1 b2; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; typedef unsigned __uint;
66
; struct s1 { int a1; __uint a2:9; __uint a3:4; };

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; enum A { AA = -1, AB = 0, }; /* signed */
66
; enum B { BA = 0, BB = 1, }; /* unsigned */

llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
; Source code:
55
; enum A { AA = -1, AB = 0, };
66
; enum B { BA = 0, BB = 1, };

llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK %s
33
; Source code:
44
; struct data_t {
55
; int d1;

llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
44
;
55
; Source Code:
66
; #define _(x) (__builtin_preserve_access_index(x))

llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK32 %s
44
; Source code:
55
; struct s {
66
; int a;

llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK32 %s
44
; Source code:
55
; struct s {
66
; int a;

llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt -O2 %s | llvm-dis > %t1
2-
; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK64 %s
3-
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK32 %s
2+
; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK64 %s
3+
; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK32 %s
44
; Source code:
55
; struct s {
66
; int a;

llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
33
; RUN: opt -passes='default<O2>' -mtriple=bpf-pc-linux %s | llvm-dis > %t1
4-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
4+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
55
; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
6-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
6+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
77
; RUN: opt -passes='default<O2>' -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
8-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
8+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
99
;
1010
; Source:
1111
; int foo();

llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
33
; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
4-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
4+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
55
;
66
; Source:
77
; int foo();

llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
33
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
44
; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
55
;

llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
33
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
44
; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
55
;

llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
33
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
44
; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
55
;

llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
2+
; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
33
; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
44
; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
55
;

llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
2+
; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
33
; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-avoid-speculation %s | llvm-dis > %t1
4-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
4+
; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
55
;
66
; Source:
77
; unsigned long foo();

llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
2-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
2+
; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
33
; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-avoid-speculation %s | llvm-dis > %t1
4-
; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
4+
; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
55
;
66
; Source:
77
; unsigned foo();

llvm/test/CodeGen/BPF/alu8.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -march=bpfel -show-mc-encoding < %s | FileCheck %s
1+
; RUN: llc -march=bpfel -mcpu=v1 -show-mc-encoding < %s | FileCheck %s
22

33
define i8 @mov(i8 %a, i8 %b) nounwind {
44
; CHECK-LABEL: mov:

llvm/test/CodeGen/BPF/atomics.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding | FileCheck %s
1+
; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding -mcpu=v1 | FileCheck %s
22
; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding -mcpu=v3 | FileCheck --check-prefix=CHECK-V3 %s
33

44
; CHECK-LABEL: test_load_add_32

llvm/test/CodeGen/BPF/basictest.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpfel | FileCheck %s
1+
; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
22

33
define i32 @test0(i32 %X) {
44
%tmp.1 = add i32 %X, 1

llvm/test/CodeGen/BPF/bpf-fastcall-2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -O2 --march=bpfel %s -o - | FileCheck %s
1+
; RUN: llc -O2 --march=bpfel -mcpu=v1 %s -o - | FileCheck %s
22

33
; Generated from the following C code:
44
;

llvm/test/CodeGen/BPF/cc_args.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
1+
; RUN: llc < %s -march=bpfel -mcpu=v1 -show-mc-encoding | FileCheck %s
22

33
define void @test() #0 {
44
entry:

llvm/test/CodeGen/BPF/cc_args_be.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
1+
; RUN: llc < %s -march=bpfeb -mcpu=v1 -show-mc-encoding | FileCheck %s
22
; test big endian
33

44
define void @test() #0 {

llvm/test/CodeGen/BPF/cc_ret.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpfel | FileCheck %s
1+
; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
22

33
define void @test() #0 {
44
entry:

llvm/test/CodeGen/BPF/cmp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -march=bpf | FileCheck %s
1+
; RUN: llc < %s -march=bpf -mcpu=v1 | FileCheck %s
22

33
; Function Attrs: nounwind readnone uwtable
44
define signext i8 @foo_cmp1(i8 signext %a, i8 signext %b) #0 {

llvm/test/CodeGen/BPF/cttz-ctlz.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2-
; RUN: llc < %s -march=bpf | FileCheck %s
2+
; RUN: llc < %s -march=bpf -mcpu=v1 | FileCheck %s
33

44
; test that we can expand CTTZ & CTLZ
55

0 commit comments

Comments
 (0)