Fix PR10422 by adding the necessary AVX UCOMISD memory versions to

load folding logic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bruno Cardoso Lopes 2011-07-22 20:53:20 +00:00
parent 44a456332f
commit dad38638e1
2 changed files with 36 additions and 2 deletions

View File

@ -407,6 +407,8 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
{ X86::Int_CVTTSS2SIrr, X86::Int_CVTTSS2SIrm, 0 },
{ X86::Int_UCOMISDrr, X86::Int_UCOMISDrm, 0 },
{ X86::Int_UCOMISSrr, X86::Int_UCOMISSrm, 0 },
{ X86::Int_VUCOMISDrr, X86::Int_VUCOMISDrm, 0 },
{ X86::Int_VUCOMISSrr, X86::Int_VUCOMISSrm, 0 },
{ X86::MOV16rr, X86::MOV16rm, 0 },
{ X86::MOV32rr, X86::MOV32rm, 0 },
{ X86::MOV64rr, X86::MOV64rm, 0 },
@ -467,7 +469,9 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
{ X86::TEST8rr, X86::TEST8rm, 0 },
// FIXME: TEST*rr EAX,EAX ---> CMP [mem], 0
{ X86::UCOMISDrr, X86::UCOMISDrm, 0 },
{ X86::UCOMISSrr, X86::UCOMISSrm, 0 }
{ X86::UCOMISSrr, X86::UCOMISSrm, 0 },
{ X86::VUCOMISDrr, X86::VUCOMISDrm, 0 },
{ X86::VUCOMISSrr, X86::VUCOMISSrm, 0 }
};
for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) {
@ -2491,7 +2495,9 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
case X86::AVX_SET0PSY:
case X86::AVX_SET0PDY:
case X86::FsFLD0SD:
case X86::FsFLD0SS: {
case X86::FsFLD0SS:
case X86::VFsFLD0SD:
case X86::VFsFLD0SS: {
// Folding a V_SET0P? or V_SETALLONES as a load, to ease register pressure.
// Create a constant-pool entry and operands to load from it.

View File

@ -0,0 +1,28 @@
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
declare void @scale() nounwind uwtable
; CHECK: vucomisd .LCPI
define void @render() nounwind uwtable {
entry:
br i1 undef, label %for.cond5, label %for.end52
for.cond5:
%or.cond = and i1 undef, false
br i1 %or.cond, label %for.body33, label %for.cond5
for.cond30:
br i1 false, label %for.body33, label %for.cond5
for.body33:
%tobool = fcmp une double undef, 0.000000e+00
br i1 %tobool, label %if.then, label %for.cond30
if.then:
call void @scale()
br label %for.cond30
for.end52:
ret void
}