Commit Graph

3 Commits

Author SHA1 Message Date
Yaxun (Sam) Liu 60963fa630 [HIP] Let clang recognize .hip extension
Differential Revision: https://reviews.llvm.org/D76039
2020-03-17 11:22:55 -04:00
Michael Liao 49f7bc9e1e [hip] Remove `-Werror=format-nonliteral`
Summary:
- It won't distinguish host and device code and trigger compilation
  failure on irrelevant code.

Reviewers: sameerds, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73224
2020-01-23 11:02:11 -05:00
Sameer Sahasrabuddhe ed181efa17 [HIP][AMDGPU] expand printf when compiling HIP to AMDGPU
Summary:
This change implements the expansion in two parts:
- Add a utility function emitAMDGPUPrintfCall() in LLVM.
- Invoke the above function from Clang CodeGen, when processing a HIP
  program for the AMDGPU target.

The printf expansion has undefined behaviour if the format string is
not a compile-time constant. As a sufficient condition, the HIP
ToolChain now emits -Werror=format-nonliteral.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D71365
2020-01-16 15:15:38 +05:30