Merge llvm trunk r321017 to contrib/llvm.
Update llvm to release_39 branch r276489, and resolve conflicts.