diff options
author | Craig Topper <craig.topper@intel.com> | 2017-11-01 18:10:06 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-11-01 18:10:06 +0000 |
commit | ca1aa83cbe22e5b3aa7345a6fd7d0e4d4b1f1d64 (patch) | |
tree | 6f6e721f11d79808c898ac7c43493005625463c1 /llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll | |
parent | 671526148c547c453d320075ec619f5519499de2 (diff) | |
download | bcm5719-llvm-ca1aa83cbe22e5b3aa7345a6fd7d0e4d4b1f1d64.tar.gz bcm5719-llvm-ca1aa83cbe22e5b3aa7345a6fd7d0e4d4b1f1d64.zip |
[X86] Prevent fast isel from folding loads into the instructions listed in hasPartialRegUpdate.
This patch moves the check for opt size and hasPartialRegUpdate into the lower level implementation of foldMemoryOperandImpl to catch the entry point that fast isel uses.
We're still folding undef register instructions in AVX that we should also probably disable, but that's a problem for another patch.
Unfortunately, this requires reordering a bunch of functions which is why the diff is so large. I can do the function reordering separately if we want.
Differential Revision: https://reviews.llvm.org/D39402
llvm-svn: 317112
Diffstat (limited to 'llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll b/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll index 432e190a745..50eddab2b45 100644 --- a/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll +++ b/llvm/test/CodeGen/X86/fast-isel-int-float-conversion-x86-64.ll @@ -21,7 +21,8 @@ entry: define double @long_to_double_rm(i64* %a) { ; SSE2-LABEL: long_to_double_rm: ; SSE2: # BB#0: # %entry -; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0 +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: cvtsi2sdq %rax, %xmm0 ; SSE2-NEXT: retq ; ; AVX-LABEL: long_to_double_rm: @@ -34,6 +35,22 @@ entry: ret double %1 } +define double @long_to_double_rm_optsize(i64* %a) optsize { +; SSE2-LABEL: long_to_double_rm_optsize: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: cvtsi2sdq (%rdi), %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_double_rm_optsize: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2sdq (%rdi), %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = load i64, i64* %a + %1 = sitofp i64 %0 to double + ret double %1 +} + define float @long_to_float_rr(i64 %a) { ; SSE2-LABEL: long_to_float_rr: ; SSE2: # BB#0: # %entry @@ -52,7 +69,8 @@ entry: define float @long_to_float_rm(i64* %a) { ; SSE2-LABEL: long_to_float_rm: ; SSE2: # BB#0: # %entry -; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0 +; SSE2-NEXT: movq (%rdi), %rax +; SSE2-NEXT: cvtsi2ssq %rax, %xmm0 ; SSE2-NEXT: retq ; ; AVX-LABEL: long_to_float_rm: @@ -64,3 +82,19 @@ entry: %1 = sitofp i64 %0 to float ret float %1 } + +define float @long_to_float_rm_optsize(i64* %a) optsize { +; SSE2-LABEL: long_to_float_rm_optsize: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: cvtsi2ssq (%rdi), %xmm0 +; SSE2-NEXT: retq +; +; AVX-LABEL: long_to_float_rm_optsize: +; AVX: # BB#0: # %entry +; AVX-NEXT: vcvtsi2ssq (%rdi), %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %0 = load i64, i64* %a + %1 = sitofp i64 %0 to float + ret float %1 +} |