[SDAG] Simplify the code for handling single-value nodes and add
a missing transfer of debug information (without which tests fail).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214021 91177308-0d34-0410-b5e6-96231b3b80d8
[SDAG] Add an assert that we don't mess up the number of values when
replacing nodes in the legalizer.

This caught a number of bugs for me during development.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214022 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Move intrinsic lowering to separate functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214023 91177308-0d34-0410-b5e6-96231b3b80d8