OSDN Git Service

bpf: Don't expand BSWAP on i32, promote it
authorYonghong Song <yhs@fb.com>
Tue, 13 Mar 2018 06:47:05 +0000 (06:47 +0000)
committerYonghong Song <yhs@fb.com>
Tue, 13 Mar 2018 06:47:05 +0000 (06:47 +0000)
commit87576cc8b8e897dff3e61e0ae08403663cc18fa9
tree492db6f9093022fd46be2cbc4be46c71a3181228
parent0f4700096fbf314555b39b4850373b9e9fa3f3fa
bpf: Don't expand BSWAP on i32, promote it

Currently, there is no ALU32 bswap support in eBPF ISA.

BSWAP on i32 was set to EXPAND which would need about eight instructions
for single BSWAP.

It would be more efficient to promote it to i64, then doing BSWAP on i64.
For eBPF programs, most of the promotion are zero extensions which are
likely be elimiated later by peephole optimizations.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327369 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/BPF/BPFISelLowering.cpp