radeon/ac: move common llvm build functions to a separate file.