[PATCH] D70987: [HIP] Improve opt-level handling

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 14:27:08 PST 2019


scott.linder created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The HIP toolchain invokes `llc` without an explicit opt-level, meaning
it always uses the default (-O2). This makes it impossible to use -O1,
for example. The HIP toolchain also coerces -Os/-Oz to -O2 even when
invoking opt, and it coerces -Og to -O2 rather than -O1.

Forward the opt-level to `llc` as well as `opt`, and only coerce levels
where it is required.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70987

Files:
  clang/lib/Driver/ToolChains/HIP.cpp
  clang/test/Driver/hip-toolchain-opt.hip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70987.231993.patch
Type: text/x-patch
Size: 6489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191203/35003faa/attachment-0001.bin>


More information about the cfe-commits mailing list