@@ -29,9 +29,7 @@ IN THE SOFTWARE.
29
29
#include < map>
30
30
#include < memory>
31
31
#include < mutex>
32
- #include < regex>
33
32
#include < utility>
34
- #include < cstdlib>
35
33
36
34
#include " cif/builtins/memory/buffer/impl/buffer_impl.h"
37
35
#include " cif/export/pimpl_base.h"
@@ -51,8 +49,6 @@ namespace TC{
51
49
52
50
namespace IGC {
53
51
54
- static constexpr const char * UseLegacyCMCPrefixEnv = " IGC_USE_LEGACY_CMC_PREFIX" ;
55
-
56
52
CIF_DECLARE_INTERFACE_PIMPL (FclOclTranslationCtx) : CIF::PimplBase
57
53
{
58
54
CIF_PIMPL_DECLARE_CONSTRUCTOR (CIF::Version_t version, CIF_PIMPL (FclOclDeviceCtx) *globalState,
@@ -113,19 +109,7 @@ CIF_DECLARE_INTERFACE_PIMPL(FclOclTranslationCtx) : CIF::PimplBase
113
109
CIF::Builtins::BufferSimple *tracingOptions,
114
110
uint32_t tracingOptionsCount
115
111
) {
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" ))) {
129
113
assert (this ->outType == CodeType::spirV);
130
114
return TranslateCM (outVersion, src, options, internalOptions, tracingOptions, tracingOptionsCount);
131
115
}
0 commit comments