<div dir="ltr"><div><div><div><div><div>Still having trouble with generating AVX2 instructions.<br><br></div>I've tried setting the mattrs when generating the JIT:<br><br>  printf("getHostCPUFeatures(): %s\n", features);<br><br>  std::vector< std::string> machine_attrs;<br>  machine_attrs.push_back(features);<br><br>  std::string Error;<br>  EngineBuilder builder(std::move(Mod));<br>  builder.setEngineKind(EngineKind::JIT)<br>         .setErrorStr(&Error)<br>         .setOptLevel((CodeGenOpt::Level)options.OptLevel)<br>         .setCodeModel(unwrap(options.CodeModel))<br>         .setTargetOptions(targetOptions)<br>         .setMCPU(llvm::sys::getHostCPUName())<br>         .setMAttrs(machine_attrs);<br><br></div>where features is:<br><br>GetHostCPUFeatures(): +sse2,+cx16,+bmi2,+fsgsbase,+popcnt,+aes,+mmx,+xsave,+invpcid,+avx,+fma,+bmi,+rdrnd,+sse4.1,+sse4.2,+avx2,+sse,+lzcnt,+pclmul,+f16c,+ssse3,+cmov,+movbe,+xsaveopt,+sse3<br><br></div>Anything I am missing?<br><br></div>Do the module target-features override the MAttr, or the reverse?<br><br></div>Toshi<br><br><div><div><div><br><br></div></div></div></div>