OSDN Git Service

[X86] Remove offset of 8 from the call to FuseInst for UNPCKLPDrr folding added in...
authorCraig Topper <craig.topper@intel.com>
Sun, 14 Jul 2019 04:13:33 +0000 (04:13 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 14 Jul 2019 04:13:33 +0000 (04:13 +0000)
This was copy/pasted from above and I forgot to change it. We just
need the default offset of 0 here.

Fixes PR42616.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366011 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/pr42616.ll [new file with mode: 0644]

index 38b66d8..e5d3a09 100644 (file)
@@ -4641,7 +4641,7 @@ MachineInstr *X86InstrInfo::foldMemoryOperandCustom(
       unsigned RCSize = TRI.getRegSizeInBits(*RC) / 8;
       if ((Size == 0 || Size >= 16) && RCSize >= 16 && Align < 16) {
         MachineInstr *NewMI =
-            FuseInst(MF, X86::MOVHPDrm, OpNum, MOs, InsertPt, MI, *this, 8);
+            FuseInst(MF, X86::MOVHPDrm, OpNum, MOs, InsertPt, MI, *this);
         return NewMI;
       }
     }
diff --git a/test/CodeGen/X86/pr42616.ll b/test/CodeGen/X86/pr42616.ll
new file mode 100644 (file)
index 0000000..961d99b
--- /dev/null
@@ -0,0 +1,11 @@
+; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=sse2 | FileCheck %s
+
+define <2 x double> @pr42616(<2 x double> %a0, <2 x double> %a1, <2 x double>* %p) {
+  ;CHECK-LABEL: pr42616
+  ;CHECK:       movhpd (%esp), {{%xmm[0-9][0-9]*}} {{.*#+}} 16-byte Folded Reload
+  %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
+  %2 = load <2 x double>, <2 x double>* %p, align 1
+  %3 = shufflevector <2 x double> %a1, <2 x double> %2, <2 x i32> <i32 2, i32 0>
+  %4 = fadd <2 x double> %a0, %3
+  ret <2 x double> %4
+}