X86 cost model: Model cost for uitofp and sitofp on SSE2
authorArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 8 Apr 2013 18:05:48 +0000 (18:05 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Mon, 8 Apr 2013 18:05:48 +0000 (18:05 +0000)
commit813456527e73f0c1468514c523c6258d360bcd91
tree8d591bd96535e20f89a92083517f1bc0669f8952
parent6b369ceb582f2deba9c252af301667975456ff86
X86 cost model: Model cost for uitofp and sitofp on SSE2

The costs are overfitted so that I can still use the legalization factor.

For example the following kernel has about half the throughput vectorized than
unvectorized when compiled with SSE2. Before this patch we would vectorize it.

unsigned short A[1024];
double B[1024];
void f() {
  int i;
  for (i = 0; i < 1024; ++i) {
    B[i] = (double) A[i];
  }
}

radar://13599001

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179033 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86TargetTransformInfo.cpp
test/Analysis/CostModel/X86/sitofp.ll [new file with mode: 0644]
test/Analysis/CostModel/X86/uitofp.ll [new file with mode: 0644]