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)
commit905d13c1230685eb11b2a00b26773f5f052e80db
treea129820224a17d002c54bd5515eadeb7d7b1b517
parent89e47ac67150ec2287db0d4541196d0a4d3f96cc
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>
llvm-svn: 327366
llvm/lib/Target/BPF/BPFMIPeephole.cpp
llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll