LLMV JIT AVX2 support

Currently I’m trying to coax the LLVM MCJIT (via the llvm-c interface) into generating AVX2 code.

My understanding is:

  1. There seems to be two ways to do this: by either setting a module attribute or by using LLVMCreateTargetMachine().

  2. Which is the preferred way of doing this?

  3. Is there a good resource on how to do this?

All help appreciated.