Skip to content

Commit f5607a5

Browse files
aparshin-inteligcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 835e550
fcl options string *must* start with "-cmc" to invoke CM frontend
1 parent 0bd3eff commit f5607a5

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

IGC/AdaptorOCL/ocl_igc_interface/impl/fcl_ocl_translation_ctx_impl.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,9 @@ static std::vector<const char*>
206206
else
207207
llvm::cl::TokenizeGNUCommandLine(userArgsStr, stringSaver, userArgs);
208208

209-
if (std::getenv(UseLegacyCMCPrefixEnv)) {
210-
// TODO: remove this branch once all clients fixed their tests
211-
auto toErase = std::remove_if(userArgs.begin(), userArgs.end(),
212-
[](const auto& Item) { return std::strcmp(Item, "-cmc") == 0; });
213-
userArgs.erase(toErase, userArgs.end());
214-
} else {
215-
IGC_ASSERT(!userArgs.empty() && strcmp(userArgs[0], "-cmc") == 0);
216-
userArgs.erase(userArgs.begin());
217-
}
209+
auto toErase = std::remove_if(userArgs.begin(), userArgs.end(),
210+
[](const auto& Item) { return std::strcmp(Item, "-cmc") == 0; });
211+
userArgs.erase(toErase, userArgs.end());
218212

219213
// this was old hack before FE can pass platform, now we prefer to use argument
220214
// but if it is null, it may be still useful, so let it be for a while

IGC/AdaptorOCL/ocl_igc_interface/impl/fcl_ocl_translation_ctx_impl.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ IN THE SOFTWARE.
2929
#include <map>
3030
#include <memory>
3131
#include <mutex>
32-
#include <regex>
3332
#include <utility>
34-
#include <cstdlib>
3533

3634
#include "cif/builtins/memory/buffer/impl/buffer_impl.h"
3735
#include "cif/export/pimpl_base.h"
@@ -51,8 +49,6 @@ namespace TC{
5149

5250
namespace IGC {
5351

54-
static constexpr const char* UseLegacyCMCPrefixEnv = "IGC_USE_LEGACY_CMC_PREFIX";
55-
5652
CIF_DECLARE_INTERFACE_PIMPL(FclOclTranslationCtx) : CIF::PimplBase
5753
{
5854
CIF_PIMPL_DECLARE_CONSTRUCTOR(CIF::Version_t version, CIF_PIMPL(FclOclDeviceCtx) *globalState,
@@ -113,19 +109,7 @@ CIF_DECLARE_INTERFACE_PIMPL(FclOclTranslationCtx) : CIF::PimplBase
113109
CIF::Builtins::BufferSimple *tracingOptions,
114110
uint32_t tracingOptionsCount
115111
) {
116-
auto needsCMFE = [](const char *optStart, size_t size) {
117-
if (!optStart)
118-
return false;
119-
120-
// TODO: remove this once all clients fixed their tests
121-
if (std::getenv(UseLegacyCMCPrefixEnv)) {
122-
return strstr(optStart, "-cmc") != nullptr;
123-
}
124-
// "-cmc" should be present as the first argument to invoke CM frontend
125-
return std::regex_match(optStart, optStart + size,
126-
std::regex("^\\s*-cmc(($)|(\\s+.*))"));
127-
};
128-
if (options != nullptr && needsCMFE(options->GetMemory<char>(), options->GetSizeRaw())) {
112+
if ((options != nullptr) && (options->GetSizeRaw() > 0) && (strstr(options->GetMemory<char>(), "-cmc"))) {
129113
assert(this->outType == CodeType::spirV);
130114
return TranslateCM(outVersion, src, options, internalOptions, tracingOptions, tracingOptionsCount);
131115
}

0 commit comments

Comments
 (0)