[llvm-commits] [llvm] r135801 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/avx-cmp-fp.ll
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Fri Jul 22 13:53:20 PDT 2011
Author: bruno
Date: Fri Jul 22 15:53:20 2011
New Revision: 135801
URL: http://llvm.org/viewvc/llvm-project?rev=135801&view=rev
Log:
Fix PR10422 by adding the necessary AVX UCOMISD memory versions to
load folding logic
Added:
llvm/trunk/test/CodeGen/X86/avx-cmp-fp.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=135801&r1=135800&r2=135801&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Fri Jul 22 15:53:20 2011
@@ -407,6 +407,8 @@
{ 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 @@
{ 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 @@
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.
Added: llvm/trunk/test/CodeGen/X86/avx-cmp-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-cmp-fp.ll?rev=135801&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx-cmp-fp.ll (added)
+++ llvm/trunk/test/CodeGen/X86/avx-cmp-fp.ll Fri Jul 22 15:53:20 2011
@@ -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
+}
+
More information about the llvm-commits
mailing list