P4 to Git Change 1451958 by skudchad@skudchad_test_win_opencl2 on 2017/08/25 19:27:11
SWDEV-116136 - Support -Og for Clang ReviewBoardURL = http://ocltc.amd.com/reviews/r/13341/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/codegen.cpp#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/linker.cpp#4 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/opt_level.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/opt_level.hpp#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/optimizer.cpp#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/gpu/hsail_be.cpp#5 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/gpu/scwrapper/scState.cpp#7 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/OPTIONS.def#7 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/options.cpp#5 edit ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/utils/options.hpp#5 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/codegen.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#157 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/opt_level.cpp#33 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/opt_level.hpp#7 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/optimizer.cpp#30 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.cpp#68 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/OPTIONS.def#136 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#42 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.hpp#19 edit
This commit is contained in:
@@ -128,10 +128,10 @@ getDefault2(int OptDescTableIx, int64_t& idefault2, const char*& sdefault2)
|
||||
break;
|
||||
|
||||
case OID_OptLevel:
|
||||
idefault2 = 3;
|
||||
idefault2 = amd::option::OPT_O3;
|
||||
break;
|
||||
|
||||
case OID_OptUseNative:
|
||||
case OID_OptUseNative:
|
||||
sdefault2 = "all";
|
||||
break;
|
||||
|
||||
@@ -285,6 +285,8 @@ ShowOptionsHelp(const char* helpValue, Options& Opts)
|
||||
case OT_UINT32:
|
||||
pntVal = "<number>";
|
||||
break;
|
||||
case OT_UCHAR:
|
||||
pntVal = "<0-9 | a-z>";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -425,6 +427,10 @@ setOptionVariable (OptionDescriptor* oDesc, OptionVariables* oVars,
|
||||
OT_CSTRING_t* o = reinterpret_cast<OT_CSTRING_t*>(addr);
|
||||
*o = static_cast<OT_CSTRING_t>(SValue);
|
||||
}
|
||||
else if (OPTION_type(oDesc) == OT_UCHAR) {
|
||||
OT_UCHAR_t* o = reinterpret_cast<OT_UCHAR_t*>(addr);
|
||||
*o = static_cast<OT_UCHAR_t>(IValue);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
@@ -452,6 +458,11 @@ setOptionVariable (OptionDescriptor* oDesc, OptionVariables* srcOVars,
|
||||
OT_UINT32_t* dst = reinterpret_cast<OT_UINT32_t*>(dstAddr);
|
||||
*dst = *src;
|
||||
}
|
||||
else if (OPTION_type(oDesc) == OT_UCHAR) {
|
||||
OT_UCHAR_t* src = reinterpret_cast<OT_UCHAR_t*>(srcAddr);
|
||||
OT_UCHAR_t* dst = reinterpret_cast<OT_UCHAR_t*>(dstAddr);
|
||||
*dst = *src;
|
||||
}
|
||||
else if (OPTION_type(oDesc) == OT_CSTRING) {
|
||||
OT_CSTRING_t* src = reinterpret_cast<OT_CSTRING_t*>(srcAddr);
|
||||
OT_CSTRING_t* dst = reinterpret_cast<OT_CSTRING_t*>(dstAddr);
|
||||
@@ -670,6 +681,12 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
|
||||
}
|
||||
break;
|
||||
|
||||
case OT_UCHAR:
|
||||
{
|
||||
ival = Value.at(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case OT_INT32:
|
||||
ival = ::strtol(Value.c_str(), &p, 0);
|
||||
if (*p != '\0') {
|
||||
@@ -741,6 +758,14 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
|
||||
}
|
||||
break;
|
||||
|
||||
case OID_OptLevel:
|
||||
if (ival == 'g') {
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
Opts.clangOptions.push_back("-Og");
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case OID_FiniteMathOnly:
|
||||
Opts.setFlag(OID_FiniteMathOnly, 1);
|
||||
tod = &OptDescTable[OID_FiniteMathOnly];
|
||||
@@ -833,7 +858,6 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case OID_DisableAllWarnings:
|
||||
if (ival != 0) {
|
||||
Opts.clcOptions.append(" --no_warnings");
|
||||
@@ -1597,6 +1621,11 @@ bool Options::equals(const Options& other, bool ignoreClcOptions) const
|
||||
OT_CSTRING_t* o2 = reinterpret_cast<OT_CSTRING_t*>(addr2);
|
||||
if (!isCStrOptionsEqual(*o,*o2)) return false;
|
||||
}
|
||||
else if (OPTION_type(od) == OT_UCHAR) {
|
||||
OT_UCHAR_t* o = reinterpret_cast<OT_UCHAR_t*>(addr);
|
||||
OT_UCHAR_t* o2 = reinterpret_cast<OT_UCHAR_t*>(addr2);
|
||||
if (*o != *o2) return false;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user