OSDN Git Service

Many of the SSE patterns should not be selected when AVX is available. This led to...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 8 Dec 2011 19:00:42 +0000 (19:00 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 8 Dec 2011 19:00:42 +0000 (19:00 +0000)
commit2f435511e98299f61093b46e479dfdb5a904a066
tree4a9bbd7cc84cb44aed244083ddd59c549a20ca1f
parent3b0887e291eec345c4848888c4604aff4f5f1e19
Many of the SSE patterns should not be selected when AVX is available. This led to the following code in X86Subtarget.cpp

  if (HasAVX)
    X86SSELevel = NoMMXSSE;

This is so patterns that are predicated on hasSSE3, etc. would not be selected when avx is available. Instead, the AVX variant is selected.
However, this breaks instructions which do not have AVX variants.

The right way to fix this is for the SSE but not-AVX patterns to predicate on something like hasSSE3() && !hasAVX().
Then we can take out the hack in X86Subtarget.cpp. Patterns which do not have AVX variants do not need to change.

However, we need to audit all the patterns before we make the change. This patch is workaround that fixes one specific case,
the prefetch instructions. rdar://10538297

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146163 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrFormats.td
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86InstrSSE.td
lib/Target/X86/X86Subtarget.h