In current OpenCL implementation some options are set in OpenCL RT/Driver, which causes discrepancy between online and offline paths.
Implement infrastructure to move options from OpenCL RT/Driver to AMDGPUToolChain using overloaded TranslateArgs() method.
Create map for default options values, as Options.td doesn't support default values (in contrast with OPTIONS.def).
Add two driver options: -On and -mNN (like -O3, -m64).
Some minor formatting changes to follow the clang-format style.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Driver/ToolChains/AMDGPU.cpp | ||
---|---|---|
60–62 ↗ | (On Diff #113549) | redundant braces |
74–75 ↗ | (On Diff #113549) | One hasArg might be used for all. |
lib/Driver/ToolChains/AMDGPU.h | ||
50 ↗ | (On Diff #113549) | const Ref might be returned here. |
51–52 ↗ | (On Diff #113549) | Check on not found opt is needed. |
60 ↗ | (On Diff #113549) | Return arg on the same line. |
lib/Driver/ToolChains/AMDGPU.h | ||
---|---|---|
44 ↗ | (On Diff #113549) | Is it really needed to create map in the header? |
Comment Actions
Several requested changes:
- move map initialization out of header file -- visually it looks better in .h file, but logically it should be in .cpp
- add assert() in getOptionDefault() -- check for unknown to OptionsDefault option
- combine args for OPT_O check
- use const StrinRef instead of std::string in the map and getOptionDefault() -- that eliminates conversion in AddJoinedArg()
- eliminate redundant brackets
ToDo:
- test
lib/Driver/ToolChains/AMDGPU.h | ||
---|---|---|
60 ↗ | (On Diff #113549) | That's how clang-format sees it: |