@@ -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
5250namespace IGC {
5351
54- static constexpr const char * UseLegacyCMCPrefixEnv = " IGC_USE_LEGACY_CMC_PREFIX" ;
55-
5652CIF_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