Changeset 4755


Ignore:
Timestamp:
Sep 2, 2015, 1:39:00 PM (3 years ago)
Author:
lindanl
Message:

Add an option to use AVX2 instructions.

File:
1 edited

Legend:

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

    r4750 r4755  
    101101#endif
    102102
     103static cl::opt<bool> UseAVX2("use-AVX2", cl::init(false), cl::desc("execute with AVX2 instruction set."), cl::cat(cRegexOutputOptions));
     104
    103105static unsigned firstInputFile = 1;  // Normal case when first positional arg is a regex.
    104106
     
    264266    builder.setMCPU(sys::getHostCPUName());
    265267    builder.setOptLevel(CodeGenOpt::Level::None);
     268#if (BLOCK_SIZE == 256)
     269    if(UseAVX2){
     270            std::vector<std::string> attrs;
     271            attrs.push_back("avx2");
     272            builder.setMAttrs(attrs);
     273    }
     274#endif
    266275    //builder.setOptLevel(mMaxWhileDepth ? CodeGenOpt::Level::Less : CodeGenOpt::Level::None);
    267276    ExecutionEngine * engine = builder.create();
Note: See TracChangeset for help on using the changeset viewer.