[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)

Tim Northover t.p.northover at gmail.com
Thu Sep 12 12:58:30 PDT 2013

Hi Adam,

> OK. I know the reason you cannot reproduce it, before posting
> the patch I've decided to check for AVX before checking AVX2,
> just not to cpuid AVX2 when we don't have AVX1 anyway.

I suspect it was also incompetence on my part. Given the differences
I'm seeing now I can't believe there'd be *no* difference in my tests
if I'd done them properly.

Anyway, thanks very much for the information. Hopefully that'll let me
track things down.

> Also attaching patch that removes volatile, but leaves
> HasAVX check that makes the code run fine here.

Would you mind me taking a day or so to investigate what's going on
here properly? Introducing a volatile to work around a bug in Clang
itself just seems perverse to me. (And we shouldn't let a CodeGen bug
dictate how we implement our functions either).

I promise I'll do the review of your code after that.



More information about the llvm-dev mailing list