Changeset 5026


Ignore:
Timestamp:
May 4, 2016, 11:50:51 AM (19 months ago)
Author:
cameron
Message:

Updates for LLVM 3.8; hide unrelated command line options

Location:
icGREP/icgrep-devel/icgrep
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.cpp

    r5014 r5026  
    2424}
    2525
    26 
    27 Constant* geti8StrVal(Module& M, char const* str, Twine const& name) {
    28     LLVMContext& ctx = getGlobalContext();
    29     Constant* strConstant = ConstantDataArray::getString(ctx, str);
    30     GlobalVariable* GVStr = new GlobalVariable(M, strConstant->getType(), true, GlobalValue::InternalLinkage, strConstant, name);
    31     Constant* zero = Constant::getNullValue(IntegerType::getInt32Ty(ctx));
    32     Constant* indices[] = {zero, zero};
    33     Constant* strVal = ConstantExpr::getGetElementPtr(GVStr, indices, true);
    34     return strVal;
    35 }
    3626
    3727static Function * create_printf(Module * const mod) {
     
    6252        IRBuilder<> builder(entry);
    6353        std::vector<Value *> args;
    64         args.push_back(geti8StrVal(*mMod, out.str().c_str(), ""));
     54        args.push_back(CreateGlobalStringPtr(out.str().c_str()));
    6555        Value * const name = &*(arg++);
    6656        name->setName("name");
     
    7969    }
    8070    assert (value->getType()->canLosslesslyBitCastTo(mBitBlockType));
    81     CreateCall(printRegister, {geti8StrVal(*mMod, name.c_str(), name), CreateBitCast(value, mBitBlockType)});
     71    CreateCall(printRegister, {CreateGlobalStringPtr(name.c_str()), CreateBitCast(value, mBitBlockType)});
    8272}
    8373
     
    9282        IRBuilder<> builder(entry);
    9383        std::vector<Value *> args;
    94         args.push_back(geti8StrVal(*mMod, out.c_str(), ""));
     84        args.push_back(CreateGlobalStringPtr(out.c_str()));
    9585        Value * const name = &*(arg++);
    9686        name->setName("name");
     
    111101    }
    112102    assert (num->getType()->isIntegerTy());
    113     CreateCall(printRegister, {geti8StrVal(*mMod, name.c_str(), name), num});
     103    CreateCall(printRegister, {CreateGlobalStringPtr(name.c_str()), num});
    114104}
    115105
  • icGREP/icgrep-devel/icgrep/casefold.cpp

    r4993 r5026  
    197197
    198198int main(int argc, char *argv[]) {
    199     StringMap<cl::Option*> Map;
    200     cl::getRegisteredOptions(Map);
    201     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    202     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    203     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    204     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    205     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    206     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    207     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    208     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    209     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    210     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    211     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    212     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    213     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    214     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    215     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    216     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    217     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    218     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    219     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    220     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    221     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    222     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    223     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
    224 
    225199    cl::ParseCommandLineOptions(argc, argv);
    226200
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5025 r5026  
    1919
    2020#include <iostream> // MEEE
    21 static cl::OptionCategory CountOnlyOptions("CountOnly Option",
    22                                        "This option controls the output.");
    23 static cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(CountOnlyOptions));
     21static cl::OptionCategory LegacyGrepOptions("A. Standard Grep Options",
     22                                       "These are standard grep options intended for compatibility with typical grep usage.");
     23static cl::OptionCategory EnhancedGrepOptions("B. Enhanced Grep Options",
     24                                       "These are additional options for icgrep functionality and performance.");
     25static cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(LegacyGrepOptions));
    2426static cl::alias CountOnlyLong("count", cl::desc("Alias for -c"), cl::aliasopt(CountOnly));
    2527
    26 static cl::OptionCategory aRegexSourceOptions("Regular Expression Options",
    27                                        "These options control the regular expression source.");
    28 
    2928static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<regex> <input file ...>"), cl::OneOrMore);
    3029
    31 static cl::opt<bool> CaseInsensitive("i", cl::desc("Ignore case distinctions in the pattern and the file."), cl::cat(aRegexSourceOptions));
    32 
    33 
    34 static cl::list<std::string> regexVector("e", cl::desc("Regular expression"), cl::ZeroOrMore, cl::cat(aRegexSourceOptions));
    35 static cl::opt<std::string> RegexFilename("f", cl::desc("Take regular expressions (one per line) from a file"), cl::value_desc("regex file"), cl::init(""), cl::cat(aRegexSourceOptions));
    36 static cl::opt<std::string> IRFileName("precompiled", cl::desc("Use precompiled regular expression"), cl::value_desc("LLVM IR file"), cl::init(""), cl::cat(aRegexSourceOptions));
     30static cl::opt<bool> CaseInsensitive("i", cl::desc("Ignore case distinctions in the pattern and the file."), cl::cat(LegacyGrepOptions));
     31
     32
     33static cl::list<std::string> regexVector("e", cl::desc("Regular expression"), cl::ZeroOrMore, cl::cat(LegacyGrepOptions));
     34static cl::opt<std::string> RegexFilename("f", cl::desc("Take regular expressions (one per line) from a file"), cl::value_desc("regex file"), cl::init(""), cl::cat(LegacyGrepOptions));
     35static cl::opt<std::string> IRFileName("precompiled", cl::desc("Use precompiled regular expression"), cl::value_desc("LLVM IR file"), cl::init(""));
    3736
    3837static cl::opt<int> Threads("t", cl::desc("Total number of threads."), cl::init(1));
    3938
    4039static cl::opt<bool> GrepSupport("gs", cl::desc("Grep support. Pipe the output of icgrep into grep. \
    41          Gives you colored output + back-referencing capability."), cl::cat(aRegexSourceOptions));
     40         Gives you colored output + back-referencing capability."), cl::cat(EnhancedGrepOptions));
    4241
    4342
     
    204203
    205204int main(int argc, char *argv[]) {
    206     StringMap<cl::Option*> Map;
    207     cl::getRegisteredOptions(Map);
    208     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    209     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    210     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    211     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    212     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    213     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    214     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    215     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    216     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    217     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    218     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    219     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    220     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    221     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    222     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    223     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    224     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    225     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    226     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    227     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    228     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    229     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    230     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
    231 
     205    cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *>{&LegacyGrepOptions, &EnhancedGrepOptions});
    232206    cl::ParseCommandLineOptions(argc, argv);
    233207   
  • icGREP/icgrep-devel/icgrep/symboltable.cpp

    r5003 r5026  
    5454
    5555int main(int argc, char *argv[]) {
    56     StringMap<cl::Option*> Map;
    57     cl::getRegisteredOptions(Map);
    58     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    59     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    60     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    61     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    62     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    63     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    64     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    65     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    66     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    67     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    68     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    69     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    70     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    71     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    72     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    73     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    74     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    75     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    76     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    77     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    78     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    79     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    80     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
    81 
    82     cl::ParseCommandLineOptions(argc, argv);
    8356
    8457    Module * M = new Module("symboltable", getGlobalContext());
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5021 r5026  
    351351
    352352int main(int argc, char *argv[]) {
    353     StringMap<cl::Option*> Map;
    354     cl::getRegisteredOptions(Map);
    355     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    356     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    357     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    358     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    359     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    360     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    361     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    362     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    363     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    364     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    365     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    366     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    367     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    368     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    369     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    370     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    371     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    372     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    373     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    374     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    375     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    376     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    377     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
    378 
    379353    cl::ParseCommandLineOptions(argc, argv);
    380354
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5021 r5026  
    5252
    5353#include <fcntl.h>
    54 
    55 static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore);
    56 
    57 static cl::opt<bool> CountLines("l", cl::desc("Report the number of lines in each input file."), cl::init(false));
    58 static cl::opt<bool> CountWords("w", cl::desc("Report the number of lines in each input file."), cl::init(false));
    59 static cl::opt<bool> CountBytes("c", cl::desc("Report the number of bytes in each input file."), cl::init(false));
    60 static cl::opt<bool> CountChars("m", cl::desc("Report the number of characters in each input file."), cl::init(false));
     54static cl::OptionCategory wcFlags("Command Flags", "wc options");
     55
     56static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore, cl::cat(wcFlags));
     57
     58static cl::opt<bool> CountLines("l", cl::desc("Report the number of lines in each input file."), cl::init(false), cl::cat(wcFlags));
     59static cl::opt<bool> CountWords("w", cl::desc("Report the number of lines in each input file."), cl::init(false), cl::cat(wcFlags));
     60static cl::opt<bool> CountBytes("c", cl::desc("Report the number of bytes in each input file."), cl::init(false), cl::cat(wcFlags));
     61static cl::opt<bool> CountChars("m", cl::desc("Report the number of characters in each input file."), cl::init(false), cl::cat(wcFlags));
    6162
    6263
     
    438439
    439440int main(int argc, char *argv[]) {
    440     StringMap<cl::Option*> Map;
    441     cl::getRegisteredOptions(Map);
    442     Map["time-passes"]->setHiddenFlag(cl::Hidden);
    443     Map["disable-spill-fusing"]->setHiddenFlag(cl::Hidden);
    444     Map["enable-misched"]->setHiddenFlag(cl::Hidden);
    445     Map["enable-tbaa"]->setHiddenFlag(cl::Hidden);
    446     Map["exhaustive-register-search"]->setHiddenFlag(cl::Hidden);
    447     Map["join-liveintervals"]->setHiddenFlag(cl::Hidden);
    448     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    449     Map["mc-x86-disable-arith-relaxation"]->setHiddenFlag(cl::Hidden);
    450     Map["limit-float-precision"]->setHiddenFlag(cl::Hidden);
    451     Map["print-after-all"]->setHiddenFlag(cl::Hidden);
    452     Map["print-before-all"]->setHiddenFlag(cl::Hidden);
    453     Map["print-machineinstrs"]->setHiddenFlag(cl::Hidden);
    454     Map["regalloc"]->setHiddenFlag(cl::Hidden);
    455     Map["rng-seed"]->setHiddenFlag(cl::Hidden);
    456     Map["stackmap-version"]->setHiddenFlag(cl::Hidden);
    457     Map["x86-asm-syntax"]->setHiddenFlag(cl::Hidden);
    458     Map["verify-debug-info"]->setHiddenFlag(cl::Hidden);
    459     Map["verify-dom-info"]->setHiddenFlag(cl::Hidden);
    460     Map["verify-loop-info"]->setHiddenFlag(cl::Hidden);
    461     Map["verify-regalloc"]->setHiddenFlag(cl::Hidden);
    462     Map["verify-scev"]->setHiddenFlag(cl::Hidden);
    463     Map["x86-recip-refinement-steps"]->setHiddenFlag(cl::Hidden);
    464     Map["rewrite-map-file"]->setHiddenFlag(cl::Hidden);
     441    HideUnrelatedOptions(wcFlags);
    465442
    466443    cl::ParseCommandLineOptions(argc, argv);
Note: See TracChangeset for help on using the changeset viewer.