Includes remaining cases not committed in https://reviews.llvm.org/D49574
This introduces what appear to be the first unittests for SelectionDAG. Lit tests do not directly test the problem cases in these functions, so I think unittests are easier to write and audit here.
Are you intentionally adding a main() here? add_llvm_unittests should provide one already, no?