[HIP] Fix unbundling
authorYaxun Liu <Yaxun.Liu@amd.com>
Wed, 6 Jun 2018 19:44:10 +0000 (19:44 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Wed, 6 Jun 2018 19:44:10 +0000 (19:44 +0000)
commit470b833bed7078018ae73924c7e2a7505ac9bfba
treeab78172c60cc776a689029623b6b372f3840b4f2
parentcbf8446359a226466efb12ad0e1dbc66a3afe592
[HIP] Fix unbundling

HIP uses clang-offload-bundler to bundle intermediate files for host
and different gpu archs together. When a file is unbundled,
clang-offload-bundler should be called only once, and the objects
for host and different gpu archs should be passed to the next
jobs. This is because Driver maintains CachedResults which maps
triple-arch string to output files for each job.

This patch fixes a bug in Driver::BuildJobsForActionNoCache which
uses incorrect key for CachedResults for HIP which causes
clang-offload-bundler being called mutiple times and incorrect
output files being used.

It only affects HIP.

Differential Revision: https://reviews.llvm.org/D47555

llvm-svn: 334128
clang/lib/Driver/Driver.cpp
clang/test/Driver/hip-binding.hip [new file with mode: 0644]