[llvm-dev] AVX2 codegen

Eric Christopher via llvm-dev llvm-dev at lists.llvm.org
Fri May 12 11:05:30 PDT 2017


Hi Toshi!

On Tue, May 9, 2017 at 4:53 PM Toshiyasu Morita via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Still having trouble with generating AVX2 instructions.
>
> I've tried setting the mattrs when generating the JIT:
>
>   printf("getHostCPUFeatures(): %s\n", features);
>
>   std::vector< std::string> machine_attrs;
>   machine_attrs.push_back(features);
>
>   std::string Error;
>   EngineBuilder builder(std::move(Mod));
>   builder.setEngineKind(EngineKind::JIT)
>          .setErrorStr(&Error)
>          .setOptLevel((CodeGenOpt::Level)options.OptLevel)
>          .setCodeModel(unwrap(options.CodeModel))
>          .setTargetOptions(targetOptions)
>          .setMCPU(llvm::sys::getHostCPUName())
>          .setMAttrs(machine_attrs);
>
> where features is:
>
> 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
>
> Anything I am missing?
>
> Do the module target-features override the MAttr, or the reverse?
>
>
The features on the function will override the ones on the TargetMachine.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170512/85ccba7f/attachment.html>


More information about the llvm-dev mailing list