[clang] [llvm] [BPF] Make -mcpu=v3 as the default (PR #107008)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 20:06:25 PDT 2024


https://github.com/yonghong-song updated https://github.com/llvm/llvm-project/pull/107008

>From 670fa2f6bf890b34cf256241fccc23d6d1ab3695 Mon Sep 17 00:00:00 2001
From: Yonghong Song <yonghong.song at linux.dev>
Date: Sat, 31 Aug 2024 11:28:29 -0700
Subject: [PATCH] [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/ZqqiQQWRnz7H93Hc@google.com/T/#mb68d67bc8f39e35a0c3db52468b9de59b79f021f
  [2] https://github.com/llvm/llvm-project/pull/101428
  [3] https://github.com/llvm/llvm-project/pull/106494
---
 clang/lib/Basic/Targets/BPF.cpp                           | 5 ++++-
 clang/test/Preprocessor/bpf-predefined-macros.c           | 4 ++--
 llvm/lib/Target/BPF/BPFSubtarget.cpp                      | 2 ++
 llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll        | 2 +-
 .../test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll | 4 ++--
 llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll      | 4 ++--
 .../test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll | 4 ++--
 llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll      | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll   | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll   | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll   | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll   | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll   | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll   | 4 ++--
 .../BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll        | 4 ++--
 .../test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll | 4 ++--
 .../test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll | 4 ++--
 .../test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll | 4 ++--
 .../test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll | 4 ++--
 .../test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll  | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll  | 4 ++--
 .../CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll  | 4 ++--
 llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll              | 2 +-
 llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll       | 4 ++--
 llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll    | 4 ++--
 .../CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll    | 4 ++--
 llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll    | 4 ++--
 llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll                 | 8 ++++----
 llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll                 | 4 ++--
 llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll                 | 2 +-
 llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll                 | 2 +-
 llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll                 | 2 +-
 llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll                 | 2 +-
 llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll          | 4 ++--
 llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll          | 4 ++--
 llvm/test/CodeGen/BPF/alu8.ll                             | 2 +-
 llvm/test/CodeGen/BPF/atomics.ll                          | 2 +-
 llvm/test/CodeGen/BPF/basictest.ll                        | 2 +-
 llvm/test/CodeGen/BPF/bpf-fastcall-2.ll                   | 2 +-
 llvm/test/CodeGen/BPF/cc_args.ll                          | 2 +-
 llvm/test/CodeGen/BPF/cc_args_be.ll                       | 2 +-
 llvm/test/CodeGen/BPF/cc_ret.ll                           | 2 +-
 llvm/test/CodeGen/BPF/cmp.ll                              | 2 +-
 llvm/test/CodeGen/BPF/cttz-ctlz.ll                        | 2 +-
 llvm/test/CodeGen/BPF/ex1.ll                              | 2 +-
 llvm/test/CodeGen/BPF/fi_ri.ll                            | 2 +-
 llvm/test/CodeGen/BPF/i128.ll                             | 4 ++--
 llvm/test/CodeGen/BPF/intrinsics.ll                       | 4 ++--
 llvm/test/CodeGen/BPF/load.ll                             | 2 +-
 llvm/test/CodeGen/BPF/loops.ll                            | 2 +-
 llvm/test/CodeGen/BPF/many_args1.ll                       | 2 +-
 llvm/test/CodeGen/BPF/objdump_atomics.ll                  | 2 +-
 llvm/test/CodeGen/BPF/objdump_cond_op.ll                  | 2 +-
 llvm/test/CodeGen/BPF/objdump_cond_op_2.ll                | 2 +-
 llvm/test/CodeGen/BPF/objdump_imm_hex.ll                  | 4 ++--
 llvm/test/CodeGen/BPF/objdump_intrinsics.ll               | 4 ++--
 llvm/test/CodeGen/BPF/objdump_nop.ll                      | 2 +-
 llvm/test/CodeGen/BPF/objdump_static_var.ll               | 4 ++--
 llvm/test/CodeGen/BPF/objdump_trivial.ll                  | 2 +-
 llvm/test/CodeGen/BPF/pr57872.ll                          | 2 +-
 llvm/test/CodeGen/BPF/reloc-2.ll                          | 4 ++--
 llvm/test/CodeGen/BPF/remove_truncate_1.ll                | 2 +-
 llvm/test/CodeGen/BPF/remove_truncate_2.ll                | 2 +-
 llvm/test/CodeGen/BPF/remove_truncate_3.ll                | 2 +-
 llvm/test/CodeGen/BPF/remove_truncate_6.ll                | 4 ++--
 llvm/test/CodeGen/BPF/remove_truncate_8.ll                | 2 +-
 llvm/test/CodeGen/BPF/rodata_1.ll                         | 4 ++--
 llvm/test/CodeGen/BPF/rodata_2.ll                         | 4 ++--
 llvm/test/CodeGen/BPF/rodata_3.ll                         | 4 ++--
 llvm/test/CodeGen/BPF/rodata_4.ll                         | 4 ++--
 llvm/test/CodeGen/BPF/rodata_6.ll                         | 2 +-
 llvm/test/CodeGen/BPF/rodata_7.ll                         | 2 +-
 llvm/test/CodeGen/BPF/sanity.ll                           | 2 +-
 llvm/test/CodeGen/BPF/setcc.ll                            | 2 +-
 llvm/test/CodeGen/BPF/shifts.ll                           | 2 +-
 llvm/test/CodeGen/BPF/sockex2.ll                          | 2 +-
 llvm/test/CodeGen/BPF/undef.ll                            | 4 ++--
 llvm/test/CodeGen/BPF/xadd.ll                             | 4 ++--
 llvm/test/CodeGen/BPF/xadd_legal.ll                       | 8 ++++----
 .../tools/llvm-objdump/BPF/interleaved-source-test.ll     | 4 ++--
 81 files changed, 132 insertions(+), 127 deletions(-)

diff --git a/clang/lib/Basic/Targets/BPF.cpp b/clang/lib/Basic/Targets/BPF.cpp
index b5ba11a3bdca9d..a94ceee5a6a5e7 100644
--- a/clang/lib/Basic/Targets/BPF.cpp
+++ b/clang/lib/Basic/Targets/BPF.cpp
@@ -38,7 +38,10 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts,
 
   Builder.defineMacro("__BPF_FEATURE_ADDR_SPACE_CAST");
 
-  if (CPU.empty() || CPU == "generic" || CPU == "v1") {
+  if (CPU.empty())
+    CPU = "v3";
+
+  if (CPU == "generic" || CPU == "v1") {
     Builder.defineMacro("__BPF_CPU_VERSION__", "1");
     return;
   }
diff --git a/clang/test/Preprocessor/bpf-predefined-macros.c b/clang/test/Preprocessor/bpf-predefined-macros.c
index 246cbfa2d6ab7d..360b9330b75fef 100644
--- a/clang/test/Preprocessor/bpf-predefined-macros.c
+++ b/clang/test/Preprocessor/bpf-predefined-macros.c
@@ -1,5 +1,5 @@
-// RUN: %clang -E -target bpfel -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
-// RUN: %clang -E -target bpfeb -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
+// RUN: %clang -E -target bpfel -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
+// RUN: %clang -E -target bpfeb -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_NO %s
 // RUN: %clang -E -target bpfel -mcpu=v1 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V1 %s
 // RUN: %clang -E -target bpfel -mcpu=v2 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V2 %s
 // RUN: %clang -E -target bpfel -mcpu=v3 -x c -o - %s | FileCheck -check-prefix=CHECK -check-prefix=CPU_V3 %s
diff --git a/llvm/lib/Target/BPF/BPFSubtarget.cpp b/llvm/lib/Target/BPF/BPFSubtarget.cpp
index 9a8e42f3237114..305e9a2bf2cda3 100644
--- a/llvm/lib/Target/BPF/BPFSubtarget.cpp
+++ b/llvm/lib/Target/BPF/BPFSubtarget.cpp
@@ -65,6 +65,8 @@ void BPFSubtarget::initializeEnvironment() {
 }
 
 void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+  if (CPU.empty())
+    CPU = "v3";
   if (CPU == "probe")
     CPU = sys::detail::getHostCPUNameForBPF();
   if (CPU == "generic" || CPU == "v1")
diff --git a/llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll b/llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll
index e8a4f81a0240ea..a60d39e5d6c1e3 100644
--- a/llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll
+++ b/llvm/test/CodeGen/BPF/32-bit-subreg-cond-select.ll
@@ -1,4 +1,4 @@
-; RUN: llc -O2 -march=bpfel -mattr=+alu32 < %s | FileCheck %s
+; RUN: llc -O2 -march=bpfel -mcpu=v1 -mattr=+alu32 < %s | FileCheck %s
 ;
 ; unsigned int select_cc_32 (unsigned a, unsigned b, int c, int d)
 ; {
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
index 63a0945edf152a..b8b7a0b8e7c2d3 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
-; RUN: opt -O2 -S < %s | llc -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: opt -O2 -S < %s | llc -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: opt -O2 -S < %s | llc -mcpu=v1 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: opt -O2 -S < %s | llc -mcpu=v1 -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   struct s {
 ;     unsigned long long f1;
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
index 33462198eab15a..4cf0a13f31e80d 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
-; RUN: opt -O2 -S < %s | llc -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: opt -O2 -S < %s | llc -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: opt -O2 -S < %s | llc -mcpu=v1 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: opt -O2 -S < %s | llc -mcpu=v1 -mattr=+alu32 -filetype=asm | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   struct s {
 ;     unsigned long long f1;
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
index 8f344f2df9d70e..cdcd7e6f5e3744 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
 ; Source code:
 ;   struct s {
 ;     char f1;
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
index 903fcb2b30a0c0..dd7f1c7a626452 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
 ; Source code:
 ;   struct s {
 ;     char f1;
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
index a8280579ea509f..525f38de765b20 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
index 39c02da24da42c..11235b55790f1a 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1; char a2; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
index f63a3ee4de7036..e3382d658ca5e5 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1[10][10]; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
index cab5474145b46b..69872db3bed0bd 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef unsigned __uint;
 ;   struct s1 { int a1; __uint a2:9; __uint a3:4; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
index 2c56c0d1d704b4..90706e9b4b98f3 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef unsigned __uint;
 ;   struct s1 { int a1; __uint a2:9; __uint a3:4; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
index 020b53238767c4..22970401e88849 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1[10][10]; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
index f4180c0d0de351..503a26c391acf9 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
index 342a9b70291964..0327f1a0b5e891 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
index 13c79563d4fcb4..2a92d088dc6b68 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1; short a2; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
index 7790273a4978d3..6e62bb308b5801 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1:7; int a2:4; int a3:5; int a4:16;} __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
index f41c6a788f6e7c..77ea26a1ff9b3f 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { int a1; char a2; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
index 2ede30701e95b3..556f69f491aae4 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef struct s1 { char a1 [5][5]; } __s1;
 ;   union u1 { int b1; __s1 b2; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
index 9242183d15a33a..2741050b58107c 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   typedef unsigned __uint;
 ;   struct s1 { int a1; __uint a2:9; __uint a3:4; };
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
index d5fbc657d4ba7c..b71bbf3de868bc 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   enum A { AA = -1, AB = 0, }; /* signed */
 ;   enum B { BA = 0, BB = 1, };  /* unsigned */
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
index 5a2a1b7031c335..5caea9751b7908 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ; Source code:
 ;   enum A { AA = -1, AB = 0, };
 ;   enum B { BA = 0, BB = 1, };
diff --git a/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll b/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
index dbfc4d2f99fc56..9998c985e2aeeb 100644
--- a/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
+++ b/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
@@ -1,5 +1,5 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK %s
 ; Source code:
 ;   struct data_t {
 ;     int d1;
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
index 7980c02bde4282..499e368983f3a5 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-ALU32 %s
 ;
 ; Source Code:
 ;   #define _(x) (__builtin_preserve_access_index(x))
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
index a0febc3a98a766..34ea050513671a 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK32 %s
 ; Source code:
 ;   struct s {
 ;     int a;
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
index 6fdf985aec6417..01c5e69ff40690 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EB,CHECK32 %s
 ; Source code:
 ;   struct s {
 ;     int a;
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
index 5cbafa15d643bc..d458d416b383ae 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
@@ -1,6 +1,6 @@
 ; RUN: opt -O2 %s | llvm-dis > %t1
-; RUN: llc -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK64 %s
-; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK32 %s
+; RUN: llc -mcpu=v1 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK64 %s
+; RUN: llc -mcpu=v1 -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK,CHECK-EL,CHECK32 %s
 ; Source code:
 ;   struct s {
 ;     int a;
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
index be8675f0843028..8a4b37d4d2129a 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
@@ -1,11 +1,11 @@
 ; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
 ; RUN: opt -passes='default<O2>' -mtriple=bpf-pc-linux %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
 ; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
 ; RUN: opt -passes='default<O2>' -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
 ;
 ; Source:
 ;   int foo();
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
index cfc9e886653a2f..ad157fe66d48ba 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK %s
 ; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-serialize-icmp %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK-DISABLE %s
 ;
 ; Source:
 ;   int foo();
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
index 5b81a01e518358..7c38b354b43447 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
@@ -1,5 +1,5 @@
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
 ; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
 ;
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
index 0c2b7cb9db9f35..8c58bb81c97cae 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
@@ -1,5 +1,5 @@
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
 ; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
 ;
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
index 2f167a355d8624..1074aa41f3e83c 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
@@ -1,5 +1,5 @@
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
 ; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
 ;
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
index 99815c01f1afaa..172bee5c778d67 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
@@ -1,5 +1,5 @@
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
+; RUN: llc %t1 -mcpu=v1 -o - | FileCheck -check-prefixes=CHECK,CHECK-V1 %s
 ; RUN: opt -O2 -S -mtriple=bpf-pc-linux %s -o %t1
 ; RUN: llc %t1 -mcpu=v3 -o - | FileCheck -check-prefixes=CHECK,CHECK-V3 %s
 ;
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll b/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
index 5a38f5ec196958..d118fa0e9a76a4 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
+; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
 ; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-avoid-speculation %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
+; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
 ;
 ; Source:
 ;   unsigned long foo();
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll b/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
index 2b841865d7243d..218fa5defac4c6 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -O2 -mtriple=bpf-pc-linux %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
+; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK %s
 ; RUN: opt -O2 -mtriple=bpf-pc-linux -bpf-disable-avoid-speculation %s | llvm-dis > %t1
-; RUN: llc %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
+; RUN: llc -mcpu=v1 %t1 -o - | FileCheck -check-prefixes=CHECK-COMMON,CHECK-DISABLE %s
 ;
 ; Source:
 ;   unsigned foo();
diff --git a/llvm/test/CodeGen/BPF/alu8.ll b/llvm/test/CodeGen/BPF/alu8.ll
index 87ba62be810d0d..21a1dd37253f23 100644
--- a/llvm/test/CodeGen/BPF/alu8.ll
+++ b/llvm/test/CodeGen/BPF/alu8.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=bpfel -show-mc-encoding < %s | FileCheck %s
+; RUN: llc -march=bpfel -mcpu=v1 -show-mc-encoding < %s | FileCheck %s
 
 define i8 @mov(i8 %a, i8 %b) nounwind {
 ; CHECK-LABEL: mov:
diff --git a/llvm/test/CodeGen/BPF/atomics.ll b/llvm/test/CodeGen/BPF/atomics.ll
index c17b94af5f7bd9..bc466c23c26236 100644
--- a/llvm/test/CodeGen/BPF/atomics.ll
+++ b/llvm/test/CodeGen/BPF/atomics.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding -mcpu=v1 | FileCheck %s
 ; RUN: llc < %s -march=bpfel -verify-machineinstrs -show-mc-encoding -mcpu=v3 | FileCheck --check-prefix=CHECK-V3 %s
 
 ; CHECK-LABEL: test_load_add_32
diff --git a/llvm/test/CodeGen/BPF/basictest.ll b/llvm/test/CodeGen/BPF/basictest.ll
index 33f787aa6b05ea..fdcd706ecaf150 100644
--- a/llvm/test/CodeGen/BPF/basictest.ll
+++ b/llvm/test/CodeGen/BPF/basictest.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
 
 define i32 @test0(i32 %X) {
   %tmp.1 = add i32 %X, 1
diff --git a/llvm/test/CodeGen/BPF/bpf-fastcall-2.ll b/llvm/test/CodeGen/BPF/bpf-fastcall-2.ll
index e3e29cdddca8ea..971d5c6cd774ee 100644
--- a/llvm/test/CodeGen/BPF/bpf-fastcall-2.ll
+++ b/llvm/test/CodeGen/BPF/bpf-fastcall-2.ll
@@ -1,4 +1,4 @@
-; RUN: llc -O2 --march=bpfel %s -o - | FileCheck %s
+; RUN: llc -O2 --march=bpfel -mcpu=v1 %s -o - | FileCheck %s
 
 ; Generated from the following C code:
 ;
diff --git a/llvm/test/CodeGen/BPF/cc_args.ll b/llvm/test/CodeGen/BPF/cc_args.ll
index 1034f8c8945d91..0752469ecc2464 100644
--- a/llvm/test/CodeGen/BPF/cc_args.ll
+++ b/llvm/test/CodeGen/BPF/cc_args.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -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 bf3457e643b9c0..ae32d3cfb6d9df 100644
--- a/llvm/test/CodeGen/BPF/cc_args_be.ll
+++ b/llvm/test/CodeGen/BPF/cc_args_be.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -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 a9f6410d6ca086..7f5d1f29c0e821 100644
--- a/llvm/test/CodeGen/BPF/cc_ret.ll
+++ b/llvm/test/CodeGen/BPF/cc_ret.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
 
 define void @test() #0 {
 entry:
diff --git a/llvm/test/CodeGen/BPF/cmp.ll b/llvm/test/CodeGen/BPF/cmp.ll
index 44f00ff02c4e3f..119539cdded500 100644
--- a/llvm/test/CodeGen/BPF/cmp.ll
+++ b/llvm/test/CodeGen/BPF/cmp.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 | FileCheck %s
 
 ; Function Attrs: nounwind readnone uwtable
 define signext i8 @foo_cmp1(i8 signext %a, i8 signext %b) #0 {
diff --git a/llvm/test/CodeGen/BPF/cttz-ctlz.ll b/llvm/test/CodeGen/BPF/cttz-ctlz.ll
index f42b2e2d10871b..e0bc90aea36814 100644
--- a/llvm/test/CodeGen/BPF/cttz-ctlz.ll
+++ b/llvm/test/CodeGen/BPF/cttz-ctlz.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
-; RUN: llc < %s -march=bpf | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 | FileCheck %s
 
 ; test that we can expand CTTZ & CTLZ
 
diff --git a/llvm/test/CodeGen/BPF/ex1.ll b/llvm/test/CodeGen/BPF/ex1.ll
index 7f9ec841b40389..e4ff19f76381a4 100644
--- a/llvm/test/CodeGen/BPF/ex1.ll
+++ b/llvm/test/CodeGen/BPF/ex1.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
 
 %struct.bpf_context = type { i64, i64, i64, i64, i64, i64, i64 }
 %struct.sk_buff = type { i64, i64, i64, i64, i64, i64, i64 }
diff --git a/llvm/test/CodeGen/BPF/fi_ri.ll b/llvm/test/CodeGen/BPF/fi_ri.ll
index 9de27b7c0fef8d..c030a363ec5b73 100644
--- a/llvm/test/CodeGen/BPF/fi_ri.ll
+++ b/llvm/test/CodeGen/BPF/fi_ri.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 | FileCheck %s
 
 %struct.key_t = type { i32, [16 x i8] }
 
diff --git a/llvm/test/CodeGen/BPF/i128.ll b/llvm/test/CodeGen/BPF/i128.ll
index 6c581c574782d7..90c81fe9dd0ffb 100644
--- a/llvm/test/CodeGen/BPF/i128.ll
+++ b/llvm/test/CodeGen/BPF/i128.ll
@@ -1,5 +1,5 @@
-; RUN: llc -march=bpfel -o - %s | FileCheck %s
-; RUN: llc -march=bpfeb -o - %s | FileCheck %s
+; RUN: llc -march=bpfel -mcpu=v1 -o - %s | FileCheck %s
+; RUN: llc -march=bpfeb -mcpu=v1 -o - %s | FileCheck %s
 ; Source code:
 ;   struct ipv6_key_t {
 ;     unsigned pid;
diff --git a/llvm/test/CodeGen/BPF/intrinsics.ll b/llvm/test/CodeGen/BPF/intrinsics.ll
index 0f59fd5604732c..2158097bc967b6 100644
--- a/llvm/test/CodeGen/BPF/intrinsics.ll
+++ b/llvm/test/CodeGen/BPF/intrinsics.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck --check-prefix=CHECK-EL %s
-; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck --check-prefix=CHECK-EB %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -show-mc-encoding | FileCheck --check-prefix=CHECK-EL %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -show-mc-encoding | FileCheck --check-prefix=CHECK-EB %s
 
 ; Function Attrs: nounwind uwtable
 define i32 @ld_b(i64 %foo, ptr nocapture %bar, ptr %ctx, ptr %ctx2) #0 {
diff --git a/llvm/test/CodeGen/BPF/load.ll b/llvm/test/CodeGen/BPF/load.ll
index e9bf3119aaa2a3..048924817c4cf0 100644
--- a/llvm/test/CodeGen/BPF/load.ll
+++ b/llvm/test/CodeGen/BPF/load.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
 
 define i16 @am1(ptr %a) nounwind {
   %1 = load i16, ptr %a
diff --git a/llvm/test/CodeGen/BPF/loops.ll b/llvm/test/CodeGen/BPF/loops.ll
index a899e4dfeaf2ba..2bdaea0f737622 100644
--- a/llvm/test/CodeGen/BPF/loops.ll
+++ b/llvm/test/CodeGen/BPF/loops.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck %s
 
 define zeroext i16 @add(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
 entry:
diff --git a/llvm/test/CodeGen/BPF/many_args1.ll b/llvm/test/CodeGen/BPF/many_args1.ll
index e5e782673c507e..441da648eaa175 100644
--- a/llvm/test/CodeGen/BPF/many_args1.ll
+++ b/llvm/test/CodeGen/BPF/many_args1.ll
@@ -1,4 +1,4 @@
-; RUN: not llc -march=bpf < %s 2> %t1
+; RUN: not llc -march=bpf -mcpu=v1 < %s 2> %t1
 ; RUN: FileCheck %s < %t1
 ; CHECK: error: <unknown>:0:0: in function foo i32 (i32, i32, i32): {{t10|0x[0-f]+}}: i64 = GlobalAddress<ptr @bar> 0 too many arguments
 
diff --git a/llvm/test/CodeGen/BPF/objdump_atomics.ll b/llvm/test/CodeGen/BPF/objdump_atomics.ll
index fcc889ba300e39..b867c515937ce3 100644
--- a/llvm/test/CodeGen/BPF/objdump_atomics.ll
+++ b/llvm/test/CodeGen/BPF/objdump_atomics.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
 
 ; CHECK-LABEL: test_load_add_32
 ; CHECK: c3 21
diff --git a/llvm/test/CodeGen/BPF/objdump_cond_op.ll b/llvm/test/CodeGen/BPF/objdump_cond_op.ll
index c64a0f2f29382c..26d7f0942c540d 100644
--- a/llvm/test/CodeGen/BPF/objdump_cond_op.ll
+++ b/llvm/test/CodeGen/BPF/objdump_cond_op.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck %s
 
 ; Source Code:
 ; int gbl;
diff --git a/llvm/test/CodeGen/BPF/objdump_cond_op_2.ll b/llvm/test/CodeGen/BPF/objdump_cond_op_2.ll
index 8c9e91d4a80eaa..895b68b5a9145b 100644
--- a/llvm/test/CodeGen/BPF/objdump_cond_op_2.ll
+++ b/llvm/test/CodeGen/BPF/objdump_cond_op_2.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
 
 ; Source Code:
 ; int test(int a, int b) {
diff --git a/llvm/test/CodeGen/BPF/objdump_imm_hex.ll b/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
index 38b93e8a39b55f..6cf438da5698f3 100644
--- a/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
+++ b/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-DEC %s
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump -d --print-imm-hex - | FileCheck --check-prefix=CHECK-HEX %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-DEC %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump -d --print-imm-hex - | FileCheck --check-prefix=CHECK-HEX %s
 
 ; Source Code:
 ; int gbl;
diff --git a/llvm/test/CodeGen/BPF/objdump_intrinsics.ll b/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
index 92db0882398b64..35bae9d8b74a69 100644
--- a/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
+++ b/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-EL %s
-; RUN: llc -mtriple=bpfeb -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-EB %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-EL %s
+; RUN: llc -mtriple=bpfeb -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-EB %s
 
 ; Function Attrs: nounwind uwtable
 define i32 @ld_b(i64 %foo, ptr nocapture %bar, ptr %ctx, ptr %ctx2) #0 {
diff --git a/llvm/test/CodeGen/BPF/objdump_nop.ll b/llvm/test/CodeGen/BPF/objdump_nop.ll
index 219b51bcb1decb..bcb8c5da33906b 100644
--- a/llvm/test/CodeGen/BPF/objdump_nop.ll
+++ b/llvm/test/CodeGen/BPF/objdump_nop.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
 ;
 ; Source:
 ;   int test() {
diff --git a/llvm/test/CodeGen/BPF/objdump_static_var.ll b/llvm/test/CodeGen/BPF/objdump_static_var.ll
index b743d82fe5e3de..698d6ed1254cdd 100644
--- a/llvm/test/CodeGen/BPF/objdump_static_var.ll
+++ b/llvm/test/CodeGen/BPF/objdump_static_var.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck --check-prefix=CHECK %s
-; RUN: llc -mtriple=bpfeb -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck --check-prefix=CHECK %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck --check-prefix=CHECK %s
+; RUN: llc -mtriple=bpfeb -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex --mcpu=v1 -d - | FileCheck --check-prefix=CHECK %s
 
 ; src:
 ;   static volatile long a = 2;
diff --git a/llvm/test/CodeGen/BPF/objdump_trivial.ll b/llvm/test/CodeGen/BPF/objdump_trivial.ll
index 47a01fd45a7641..4cec018bf7d320 100644
--- a/llvm/test/CodeGen/BPF/objdump_trivial.ll
+++ b/llvm/test/CodeGen/BPF/objdump_trivial.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
 
 ; CHECK: if r2 s> r1 goto
 ; CHECK: call 1
diff --git a/llvm/test/CodeGen/BPF/pr57872.ll b/llvm/test/CodeGen/BPF/pr57872.ll
index 34f9975d6f28b5..340f4f957d6d04 100644
--- a/llvm/test/CodeGen/BPF/pr57872.ll
+++ b/llvm/test/CodeGen/BPF/pr57872.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=bpf-- | FileCheck %s
+; RUN: llc < %s -mtriple=bpf -mcpu=v1 -- | FileCheck %s
 
 %struct.event = type { i8, [84 x i8] }
 
diff --git a/llvm/test/CodeGen/BPF/reloc-2.ll b/llvm/test/CodeGen/BPF/reloc-2.ll
index 50baef7faf22cb..9bbb5f3d2fd61f 100644
--- a/llvm/test/CodeGen/BPF/reloc-2.ll
+++ b/llvm/test/CodeGen/BPF/reloc-2.ll
@@ -1,7 +1,7 @@
-; RUN: llc -mtriple=bpfel -filetype=obj -o %t.el < %s
+; RUN: llc -mtriple=bpfel -mcpu=v1 -filetype=obj -o %t.el < %s
 ; RUN: llvm-objdump -r %t.el | FileCheck --check-prefix=RELOC %s
 ; RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.el | FileCheck --check-prefix=DUMP %s
-; RUN: llc -mtriple=bpfeb -filetype=obj -o %t.eb < %s
+; RUN: llc -mtriple=bpfeb -mcpu=v1 -filetype=obj -o %t.eb < %s
 ; RUN: llvm-objdump -r %t.eb | FileCheck --check-prefix=RELOC %s
 ; RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.eb | FileCheck --check-prefix=DUMP %s
 
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_1.ll b/llvm/test/CodeGen/BPF/remove_truncate_1.ll
index 6b35d3f08c443f..cb0b139fe7aedb 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_1.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_1.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct xdp_md {
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_2.ll b/llvm/test/CodeGen/BPF/remove_truncate_2.ll
index 7a043d2342c95a..4e8d4c3e774b84 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_2.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_2.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct xdp_md {
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_3.ll b/llvm/test/CodeGen/BPF/remove_truncate_3.ll
index 82057dc8fbee9f..0ab60609f2d620 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_3.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_3.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct xdp_md {
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_6.ll b/llvm/test/CodeGen/BPF/remove_truncate_6.ll
index 54e10313cef6fd..949f58819884fc 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_6.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_6.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
-; RUN: llc < %s -march=bpf -mattr=+alu32 -verify-machineinstrs | FileCheck --check-prefix=CHECK-32 %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -mattr=+alu32 -verify-machineinstrs | FileCheck --check-prefix=CHECK-32 %s
 ;
 ; void cal1(unsigned short *a, unsigned long *b, unsigned int k)
 ; {
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_8.ll b/llvm/test/CodeGen/BPF/remove_truncate_8.ll
index e1acd22d6693de..3a13c0acd2992f 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_8.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_8.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
 ; Source Code:
 ;   struct loc_prog {
 ;     unsigned int ip;
diff --git a/llvm/test/CodeGen/BPF/rodata_1.ll b/llvm/test/CodeGen/BPF/rodata_1.ll
index 9eb1590bc96af6..6813ee8a116039 100644
--- a/llvm/test/CodeGen/BPF/rodata_1.ll
+++ b/llvm/test/CodeGen/BPF/rodata_1.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck %s
-; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct test_t1 {
diff --git a/llvm/test/CodeGen/BPF/rodata_2.ll b/llvm/test/CodeGen/BPF/rodata_2.ll
index badb1aae5ed9f0..9ec98fb08adcb5 100644
--- a/llvm/test/CodeGen/BPF/rodata_2.ll
+++ b/llvm/test/CodeGen/BPF/rodata_2.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck %s
-; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct test_t1 {
diff --git a/llvm/test/CodeGen/BPF/rodata_3.ll b/llvm/test/CodeGen/BPF/rodata_3.ll
index 259e47504d920e..696775ba74c8c3 100644
--- a/llvm/test/CodeGen/BPF/rodata_3.ll
+++ b/llvm/test/CodeGen/BPF/rodata_3.ll
@@ -1,6 +1,6 @@
 ; REQUIRES: x86_64-linux
-; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck --check-prefix=CHECK-EL %s
-; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck --check-prefix=CHECK-EB %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -verify-machineinstrs | FileCheck --check-prefix=CHECK-EL %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -verify-machineinstrs | FileCheck --check-prefix=CHECK-EB %s
 ;
 ; This test requires little-endian host, so we specific x86_64-linux here.
 ; Source code:
diff --git a/llvm/test/CodeGen/BPF/rodata_4.ll b/llvm/test/CodeGen/BPF/rodata_4.ll
index 8153492a45337a..a3eecb0e8d72df 100644
--- a/llvm/test/CodeGen/BPF/rodata_4.ll
+++ b/llvm/test/CodeGen/BPF/rodata_4.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck %s
-; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 -verify-machineinstrs | FileCheck %s
 
 ; Source code:
 ; struct test_t1
diff --git a/llvm/test/CodeGen/BPF/rodata_6.ll b/llvm/test/CodeGen/BPF/rodata_6.ll
index fe9136d15bce15..6603041e2e9433 100644
--- a/llvm/test/CodeGen/BPF/rodata_6.ll
+++ b/llvm/test/CodeGen/BPF/rodata_6.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=bpf < %s | FileCheck %s
+; RUN: llc -march=bpf -mcpu=v1 < %s | FileCheck %s
 ;
 ; Source code:
 ;   struct t1 { int a; };
diff --git a/llvm/test/CodeGen/BPF/rodata_7.ll b/llvm/test/CodeGen/BPF/rodata_7.ll
index b68cbd36822eec..c238aa7a4fd864 100644
--- a/llvm/test/CodeGen/BPF/rodata_7.ll
+++ b/llvm/test/CodeGen/BPF/rodata_7.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=bpf < %s | FileCheck %s
+; RUN: llc -march=bpf -mcpu=v1 < %s | FileCheck %s
 ;
 ; Source code:
 ;   struct t1 { int a; };
diff --git a/llvm/test/CodeGen/BPF/sanity.ll b/llvm/test/CodeGen/BPF/sanity.ll
index 117d1bb7d9522b..0a97a812bbb3f1 100644
--- a/llvm/test/CodeGen/BPF/sanity.ll
+++ b/llvm/test/CodeGen/BPF/sanity.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=bpfel-- | FileCheck %s
+; RUN: llc < %s -mtriple=bpfel -mcpu=v1 -- | 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/setcc.ll b/llvm/test/CodeGen/BPF/setcc.ll
index d82a76237a14c8..9f01f978473fa9 100644
--- a/llvm/test/CodeGen/BPF/setcc.ll
+++ b/llvm/test/CodeGen/BPF/setcc.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=bpfel < %s | FileCheck --check-prefix=CHECK-V1 %s
+; RUN: llc -march=bpfel -mcpu=v1 < %s | FileCheck --check-prefix=CHECK-V1 %s
 ; RUN: llc -march=bpfel -mcpu=v2 < %s | FileCheck --check-prefix=CHECK-V2 %s
 
 define i16 @sccweqand(i16 %a, i16 %b) nounwind {
diff --git a/llvm/test/CodeGen/BPF/shifts.ll b/llvm/test/CodeGen/BPF/shifts.ll
index 2ffcb8891c30fd..ade49d816e521e 100644
--- a/llvm/test/CodeGen/BPF/shifts.ll
+++ b/llvm/test/CodeGen/BPF/shifts.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -show-mc-encoding | FileCheck %s
 
 define zeroext i8 @lshr8(i8 zeroext %a, i8 zeroext %cnt) nounwind readnone {
 entry:
diff --git a/llvm/test/CodeGen/BPF/sockex2.ll b/llvm/test/CodeGen/BPF/sockex2.ll
index b1264099f64c60..b26192a08326e7 100644
--- a/llvm/test/CodeGen/BPF/sockex2.ll
+++ b/llvm/test/CodeGen/BPF/sockex2.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 -show-mc-encoding | FileCheck %s
 
 %struct.bpf_map_def = type { i32, i32, i32, i32 }
 %struct.sk_buff = type opaque
diff --git a/llvm/test/CodeGen/BPF/undef.ll b/llvm/test/CodeGen/BPF/undef.ll
index 0322f5972b7ee1..c0cd8f89df6a94 100644
--- a/llvm/test/CodeGen/BPF/undef.ll
+++ b/llvm/test/CodeGen/BPF/undef.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK,EL %s
-; RUN: llc < %s -march=bpfeb | FileCheck -check-prefixes=CHECK,EB %s
+; RUN: llc < %s -march=bpfel -mcpu=v1 | FileCheck -check-prefixes=CHECK,EL %s
+; RUN: llc < %s -march=bpfeb -mcpu=v1 | 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/xadd.ll b/llvm/test/CodeGen/BPF/xadd.ll
index 5aeeb9baf7b892..ed7fb130f37fea 100644
--- a/llvm/test/CodeGen/BPF/xadd.ll
+++ b/llvm/test/CodeGen/BPF/xadd.ll
@@ -1,5 +1,5 @@
-; RUN: not llc -march=bpfel < %s 2>&1 | FileCheck %s
-; RUN: not llc -march=bpfeb < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=bpfel -mcpu=v1 < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=bpfeb -mcpu=v1 < %s 2>&1 | FileCheck %s
 
 ; This file is generated with the source command and source
 ; $ clang -target bpf -O2 -g -S -emit-llvm t.c
diff --git a/llvm/test/CodeGen/BPF/xadd_legal.ll b/llvm/test/CodeGen/BPF/xadd_legal.ll
index 9b07afade3fee9..7bfe91e73e23b7 100644
--- a/llvm/test/CodeGen/BPF/xadd_legal.ll
+++ b/llvm/test/CodeGen/BPF/xadd_legal.ll
@@ -1,7 +1,7 @@
-; RUN: llc -march=bpfel < %s 2>&1 | FileCheck --check-prefix=CHECK-64 %s
-; RUN: llc -march=bpfeb < %s 2>&1 | FileCheck --check-prefix=CHECK-64 %s
-; RUN: llc -march=bpfel -mattr=+alu32 < %s 2>&1 | FileCheck --check-prefix=CHECK-32 %s
-; RUN: llc -march=bpfeb -mattr=+alu32 < %s 2>&1 | FileCheck --check-prefix=CHECK-32 %s
+; RUN: llc -march=bpfel -mcpu=v1 < %s 2>&1 | FileCheck --check-prefix=CHECK-64 %s
+; RUN: llc -march=bpfeb -mcpu=v1 < %s 2>&1 | FileCheck --check-prefix=CHECK-64 %s
+; RUN: llc -march=bpfel -mcpu=v1 -mattr=+alu32 < %s 2>&1 | FileCheck --check-prefix=CHECK-32 %s
+; RUN: llc -march=bpfeb -mcpu=v1 -mattr=+alu32 < %s 2>&1 | FileCheck --check-prefix=CHECK-32 %s
 
 ; This file is generated with the source command and source
 ; $ clang -target bpf -O2 -S -emit-llvm t.c
diff --git a/llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll b/llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll
index fb5ad51d1ea661..5d44fe10b047e5 100644
--- a/llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll
+++ b/llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll
@@ -15,7 +15,7 @@
 ;; - make sure that there are BTF but no DWARF sections in %t.o
 ;; - check llvm-objdump output when only BTF is present
 
-; RUN: llc --mtriple bpfel %t.ll --filetype=obj -o %t
+; RUN: llc --mtriple bpfel -mcpu=v1 %t.ll --filetype=obj -o %t
 ; RUN: llvm-objdump --no-show-raw-insn -S %t | FileCheck %s
 ; RUN: llvm-strip --strip-debug %t
 ; RUN: llvm-objdump --section-headers %t \
@@ -24,7 +24,7 @@
 
 ;; Next, check bpfeb (big endian):
 
-; RUN: llc --mtriple bpfeb %t.ll --filetype=obj -o %t
+; RUN: llc --mtriple bpfeb -mcpu=v1 %t.ll --filetype=obj -o %t
 ; RUN: llvm-strip --strip-debug %t
 ; RUN: llvm-objdump --no-show-raw-insn -S %t | FileCheck %s
 



More information about the llvm-commits mailing list