1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[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
This commit is contained in:
Yonghong Song 2019-11-07 10:55:59 -08:00
parent 37079e5979
commit d771b3fb3e
2 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
if (CPU == "v3") {
HasJmpExt = true;
HasJmp32 = true;
HasAlu32 = true;
return;
}
}

View File

@ -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)
; {