[bpf] Do not expand UNDEF SDNode during insn selection lowering
authorAlexei Starovoitov <alexei.starovoitov@gmail.com>
Thu, 8 Oct 2015 18:52:40 +0000 (18:52 +0000)
committerAlexei Starovoitov <alexei.starovoitov@gmail.com>
Thu, 8 Oct 2015 18:52:40 +0000 (18:52 +0000)
commit08c4d76572a1289f779cca9fc5e26d6d588657d0
tree1d76cf0ad237de12aa32ee1498aa042040adf88c
parent8b6e5f368ca02dda35a1b0e6b84f39a0890214b1
[bpf] Do not expand UNDEF SDNode during insn selection lowering

  o Before this patch, BPF backend will expand UNDEF node
    to i64 constant 0.
  o For second pass of dag combiner, legalizer will run through
    each to-be-processed dag node.
  o If any new SDNode is generated and has an undef operand,
    dag combiner will put undef node, newly-generated constant-0 node,
    and any node which uses these nodes in the working list.
  o During this process, it is possible undef operand is
    generated again, and this will form an infinite loop
    for dag combiner pass2.
  o This patch allows UNDEF to be a legal type.

Signed-off-by: Yonghong Song <yhs@plumgrid.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249718 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/BPF/BPFISelDAGToDAG.cpp
lib/Target/BPF/BPFISelLowering.cpp
test/CodeGen/BPF/sockex2.ll
test/CodeGen/BPF/undef.ll [new file with mode: 0644]