[llvm-commits] [llvm] r162741 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll

Bill Wendling isanbard at gmail.com
Tue Aug 28 00:36:46 PDT 2012


Author: void
Date: Tue Aug 28 02:36:46 2012
New Revision: 162741

URL: http://llvm.org/viewvc/llvm-project?rev=162741&view=rev
Log:
The commutative flag is already correctly set within the multiclass. If we set
it here, then a 'register-memory' version would wrongly get the commutative
flag.
<rdar://problem/12180135>

Added:
    llvm/trunk/test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll
Modified:
    llvm/trunk/lib/Target/X86/X86InstrSSE.td

Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=162741&r1=162740&r2=162741&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Aug 28 02:36:46 2012
@@ -2927,7 +2927,7 @@
   }
 }
 
-let isCommutable = 1, isCodeGenOnly = 1 in {
+let isCodeGenOnly = 1 in {
   defm VMAXC: basic_sse12_fp_binop_s<0x5F, "max", X86fmaxc, SSE_ALU_ITINS_S, 0>,
        VEX_4V, VEX_LIG;
   defm VMAXC: basic_sse12_fp_binop_p<0x5F, "max", X86fmaxc, SSE_ALU_ITINS_P, 0>,

Added: llvm/trunk/test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll?rev=162741&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2012-08-28-UnsafeMathCrash.ll Tue Aug 28 02:36:46 2012
@@ -0,0 +1,20 @@
+; RUN: llc < %s -enable-unsafe-fp-math
+; <rdar://problem/12180135>
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
+target triple = "i386-apple-macosx10.8.0"
+
+define i32 @foo(float %mean) nounwind readnone ssp align 2 {
+entry:
+  %cmp = fcmp olt float %mean, -3.000000e+00
+  %f.0 = select i1 %cmp, float -3.000000e+00, float %mean
+  %cmp2 = fcmp ult float %f.0, 3.000000e+00
+  %f.1 = select i1 %cmp2, float %f.0, float 0x4007EB8520000000
+  %add = fadd float %f.1, 3.000000e+00
+  %div = fdiv float %add, 2.343750e-02
+  %0 = fpext float %div to double
+  %conv = select i1 undef, double 2.550000e+02, double %0
+  %add8 = fadd double %conv, 5.000000e-01
+  %conv9 = fptosi double %add8 to i32
+  %.conv9 = select i1 undef, i32 255, i32 %conv9
+  ret i32 %.conv9
+}





More information about the llvm-commits mailing list