[BPF] turn on -mattr=+alu32 for cpu version v3 and later
authorYonghong Song <yhs@fb.com>
Thu, 7 Nov 2019 18:55:59 +0000 (10:55 -0800)
committerYonghong Song <yhs@fb.com>
Fri, 8 Nov 2019 06:08:46 +0000 (22:08 -0800)
commit6b8baf3062cdc7bd88867e239f26b6966ee3142c
tree10a479c892c8f18baaa05d37ee106c389deff49a
parent6602e1fb0e34c1a755ef561de24e5b78a460672a
[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
llvm/lib/Target/BPF/BPFSubtarget.cpp
llvm/test/CodeGen/BPF/32-bit-subreg-alu.ll