Ignore:
Timestamp:
Aug 16, 2015, 3:55:50 PM (4 years ago)
Author:
cameron
Message:

Embed carry data in compiled LLVM module; eliminate passing of carry data pointers/size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/generate_predefined_ucd_functions.cpp

    r4724 r4726  
    7474#endif
    7575
    76 using property_list = std::vector<std::pair<std::string, size_t>>;
     76using property_list = std::vector<std::string>;
    7777
    7878/** ------------------------------------------------------------------------------------------------------------- *
     
    219219 * @brief compileUnicodeSet
    220220 ** ------------------------------------------------------------------------------------------------------------- */
    221 size_t compileUnicodeSet(std::string name, const UnicodeSet & set, PabloCompiler & pc, Module * module) {
     221void compileUnicodeSet(std::string name, const UnicodeSet & set, PabloCompiler & pc, Module * module) {
    222222    #ifdef ENABLE_MULTIPLEXING
    223223    if (MultiplexingDistributionFile) {
     
    265265    auto func = pc.compile(function, module);
    266266    releaseSlabAllocatorMemory();
    267 
     267/*
    268268    if (LongestDependenceChainFile) {
    269269        const auto pablo_metrix = computePabloDependencyChainMetrics(function);
     
    272272        (*LongestDependenceChainFile) << ',' << llvm_metrix.first << ',' << llvm_metrix.second << '\n';
    273273    }
    274 
    275     return func.second;
     274*/
    276275}
    277276
     
    302301    header << "#include <tuple>\n";
    303302    header << "namespace UCD {\n\n";
    304     header << "using ExternalProperty = std::tuple<void *, unsigned, unsigned, size_t>;\n\n";
     303    header << "using ExternalProperty = std::tuple<void *, unsigned, unsigned>;\n\n";
    305304    header << "const ExternalProperty & resolveExternalProperty(const std::string & name);\n\n";
    306305    header << "}\n\n";
     
    329328    cpp << "struct Output {\n    BitBlock bit[1];\n};\n\n";
    330329    for (auto prop : properties) {
    331         cpp << "extern \"C\" void " + prop.first + "(const Input &, BitBlock *, Output &);\n";
     330        cpp << "extern \"C\" void " + prop + "(const Input &, Output &);\n";
    332331    }
    333332
    334333    cpp << "\nconst static std::unordered_map<std::string, ExternalProperty> EXTERNAL_UCD_PROPERTY_MAP = {\n";
    335334    for (auto itr = properties.begin(); itr != properties.end(); ) {
    336         cpp << "    {\"" + itr->first + "\", std::make_tuple(reinterpret_cast<void *>(&" + itr->first + "), 8, 1, " + std::to_string(itr->second) + ")}";
     335        cpp << "    {\"" + *itr + "\", std::make_tuple(reinterpret_cast<void *>(&" + *itr + "), 8, 1)}";
    337336        if (++itr != properties.end()) {
    338337            cpp << ",";
     
    367366                const UnicodeSet & set = enumObj->GetCodepointSet(canonicalize_value_name(value));
    368367                std::string name = "__get_" + property_enum_name[enumObj->getPropertyCode()] + "_" + value;
    369                 properties.emplace_back(name, compileUnicodeSet(name, set, pc, module));
     368                compileUnicodeSet(name, set, pc, module);
     369                properties.emplace_back(name);
    370370            }
    371371        }
     
    374374                const UnicodeSet & set = extObj->GetCodepointSet(canonicalize_value_name(value));
    375375                std::string name = "__get_" + property_enum_name[extObj->getPropertyCode()] + "_" + value;
    376                 properties.emplace_back(name, compileUnicodeSet(name, set, pc, module));
     376                compileUnicodeSet(name, set, pc, module);
     377                properties.emplace_back(name);
    377378            }
    378379        }
     
    380381            const UnicodeSet & set = binObj->GetCodepointSet(Binary_ns::Y);
    381382            std::string name = "__get_" + property_enum_name[binObj->getPropertyCode()] + "_Y";
    382             properties.emplace_back(name, compileUnicodeSet(name, set, pc, module));
     383            compileUnicodeSet(name, set, pc, module);
     384            properties.emplace_back(name);
    383385        }
    384386    }
Note: See TracChangeset for help on using the changeset viewer.