OSDN Git Service

bpf: J*_RR should check both operands
authorYonghong Song <yhs@fb.com>
Tue, 13 Mar 2018 06:47:02 +0000 (06:47 +0000)
committerYonghong Song <yhs@fb.com>
Tue, 13 Mar 2018 06:47:02 +0000 (06:47 +0000)
commit83008ad941299d2054235a73e00d949e5b1f23eb
tree5adf6c73dfe7e3c8d0399e63b57befa252796add
parentc543a072f894b6f8f30bcdf010e9e7f1ad6915dc
bpf: J*_RR should check both operands

There is a mistake in current code that we "break" out the optimization
when the first operand of J*_RR doesn't qualify the elimination. This
caused some elimination opportunities missed, for example the one in the
testcase.

The code should just fall through to handle the second operand.

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@327366 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/BPF/BPFMIPeephole.cpp
test/CodeGen/BPF/32-bit-subreg-peephole.ll