[LLVMdev] use AVX automatically if present

Henning Thielemann llvm at henning-thielemann.de
Thu May 24 14:56:48 PDT 2012


On Thu, 24 May 2012, Pan, Wei wrote:

> Very likely AVX is not enabled in your llc. This feature was enabled 
> just recently (late of April).

I forgot to mention that I am using recent LLVM-3.1 and in principle my 
llc knows about avx as I have shown in the second example. But avx does 
not seem to be used by default.


On Thu, 24 May 2012, Henning Thielemann wrote:

> $ llc -o - -mattr avx avx.ll
>        .file   "avx.ll"
>        .text
>        .globl  _fun1
>        .align  16, 0x90
>        .type   _fun1, at function
> _fun1:                                  # @_fun1
>        .cfi_startproc
> # BB#0:                                 # %_L1
>        pushq   %rbp
> .Ltmp2:
>        .cfi_def_cfa_offset 16
> .Ltmp3:
>        .cfi_offset %rbp, -16
>        movq    %rsp, %rbp
> .Ltmp4:
>        .cfi_def_cfa_register %rbp
>        vmovaps (%rdi), %ymm0
>        vaddps  (%rsi), %ymm0, %ymm0
>        vmovaps %ymm0, (%rdi)
>        popq    %rbp
>        vzeroupper
>        ret
> .Ltmp5:
>        .size   _fun1, .Ltmp5-_fun1
>        .cfi_endproc
>
>
>        .section        ".note.GNU-stack","", at progbits
>
>
>
>
> I guess your answer is that I did not specify a target triple. However why is 
> SSE41 automatically detected and AVX is not?



More information about the llvm-dev mailing list