-
Notifications
You must be signed in to change notification settings - Fork 788
[Driver][SYCL][FPGA] Do not generate host dependency files by default #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1138,6 +1138,16 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, | |
else | ||
ArgM = ArgMD; | ||
|
||
auto createFPGATempDepFile = [&](const char *&DepFile) { | ||
// Generate dependency files as temporary. These will be used for the | ||
// aoc call/bundled during fat object creation | ||
std::string BaseName(Clang::getBaseInputName(Args, Inputs[0])); | ||
std::string DepTmpName = | ||
C.getDriver().GetTemporaryPath(llvm::sys::path::stem(BaseName), "d"); | ||
DepFile = C.addTempFile(C.getArgs().MakeArgString(DepTmpName)); | ||
C.getDriver().addFPGATempDepFile(DepFile, BaseName); | ||
}; | ||
|
||
if (ArgM) { | ||
// Determine the output location. | ||
const char *DepFile; | ||
|
@@ -1148,16 +1158,9 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, | |
DepFile = Output.getFilename(); | ||
} else if (!ArgMD) { | ||
DepFile = "-"; | ||
} else if (ArgMD->getOption().matches(options::OPT_MMD) && | ||
Args.hasArg(options::OPT_fintelfpga) && | ||
} else if (Args.hasArg(options::OPT_fintelfpga) && | ||
JA.isDeviceOffloading(Action::OFK_SYCL)) { | ||
// Generate dependency files as temporary. These will be used for the | ||
// aoc call/bundled during fat object creation | ||
std::string BaseName(Clang::getBaseInputName(Args, Inputs[0])); | ||
std::string DepTmpName = | ||
C.getDriver().GetTemporaryPath(llvm::sys::path::stem(BaseName), "d"); | ||
DepFile = C.addTempFile(C.getArgs().MakeArgString(DepTmpName)); | ||
C.getDriver().addFPGATempDepFile(DepFile, BaseName); | ||
createFPGATempDepFile(DepFile); | ||
} else { | ||
DepFile = getDependencyFileName(Args, Inputs); | ||
C.addFailureResultFile(DepFile, &JA); | ||
|
@@ -1212,6 +1215,22 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, | |
CmdArgs.push_back("-module-file-deps"); | ||
} | ||
|
||
if (!ArgM && Args.hasArg(options::OPT_fintelfpga) && | ||
JA.isDeviceOffloading(Action::OFK_SYCL)) { | ||
// No dep generation option was provided, add all of the needed options | ||
// to ensure a successful dep generation. | ||
const char *DepFile; | ||
createFPGATempDepFile(DepFile); | ||
CmdArgs.push_back("-dependency-file"); | ||
CmdArgs.push_back(DepFile); | ||
CmdArgs.push_back("-MT"); | ||
SmallString<128> P(Inputs[0].getBaseInput()); | ||
llvm::sys::path::replace_extension(P, "o"); | ||
SmallString<128> Quoted; | ||
QuoteTarget(llvm::sys::path::filename(P), Quoted); | ||
CmdArgs.push_back(Args.MakeArgString(Quoted)); | ||
Comment on lines
+1227
to
+1231
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we double-check these in the test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll adjust the test accordingly. As for your There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this also affects offload static library that are passed without this flag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @meiyacha, that is correct. Offload static lib w/ and w/out -foffload-static-lib behaves the same. |
||
} | ||
|
||
if (Args.hasArg(options::OPT_MG)) { | ||
if (!ArgM || ArgM->getOption().matches(options::OPT_MD) || | ||
ArgM->getOption().matches(options::OPT_MMD)) | ||
|
Uh oh!
There was an error while loading. Please reload this page.