Update some recent patches to closer match what actually got mainlined
Rebase to llvm trunk