Slight optimizations to tceopgen, to make it run faster.
However, this does not fix the problem of broken .opp file
causing some opset info caching to fail, making tceopgen run very slowly,
this only makes this problem slightly less severe.
@@ -231,13 +231,14 @@ writeCustomOpMacros(std::ostream& os) {
for (int m = 0; m < index.moduleCount(); m++) {
OperationModule& mod = index.module(m);
try {
- for (int o = 0; o < index.operationCount(mod); o++) {
+ int opCount = index.operationCount(mod);
+ for (int o = 0; o < opCount; o++) {
std::string opName = index.operationName(o, mod);
- const Operation& op = pool.operation(opName.c_str());
if (operations.count(opName) > 0) {
continue;
}
+ const Operation& op = pool.operation(opName.c_str());
operations.insert(opName);
writeCustomOpMacro(os, opName, op, NORMAL);
