diff options
| author | Yonghong Song <yhs@fb.com> | 2019-11-07 10:55:59 -0800 |
|---|---|---|
| committer | Yonghong Song <yhs@fb.com> | 2019-11-07 22:08:46 -0800 |
| commit | 6b8baf3062cdc7bd88867e239f26b6966ee3142c (patch) | |
| tree | 10a479c892c8f18baaa05d37ee106c389deff49a /llvm | |
| parent | 6602e1fb0e34c1a755ef561de24e5b78a460672a (diff) | |
| download | bcm5719-llvm-6b8baf3062cdc7bd88867e239f26b6966ee3142c.tar.gz bcm5719-llvm-6b8baf3062cdc7bd88867e239f26b6966ee3142c.zip | |
[BPF] turn on -mattr=+alu32 for cpu version v3 and later
-mattr=+alu32 has shown good performance vs. without this attribute.
Based on discussion at
https://lore.kernel.org/bpf/1ec37838-966f-ec0b-5223-ca9b6eb0860d@fb.com/T/#t
cpu version v3 should support -mattr=+alu32.
This patch enabled alu32 if cpu version is v3, either specified by user
or probed by the llvm.
Differential Revision: https://reviews.llvm.org/D69957
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/BPF/BPFSubtarget.cpp | 1 | ||||
| -rw-r--r-- | llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/BPF/BPFSubtarget.cpp b/llvm/lib/Target/BPF/BPFSubtarget.cpp index ab3452501b9..f3cb03b1f1f 100644 --- a/llvm/lib/Target/BPF/BPFSubtarget.cpp +++ b/llvm/lib/Target/BPF/BPFSubtarget.cpp @@ -52,6 +52,7 @@ void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { if (CPU == "v3") { HasJmpExt = true; HasJmp32 = true; + HasAlu32 = true; return; } } diff --git a/llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll b/llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll index 2a498494589..2e4e92e0126 100644 --- a/llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll +++ b/llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll @@ -1,4 +1,5 @@ ; RUN: llc -O2 -march=bpfel -mattr=+alu32 < %s | FileCheck %s +; RUN: llc -O2 -march=bpfel -mcpu=v3 < %s | FileCheck %s ; ; int mov(int a) ; { |

