[llvm-commits] [llvm] r107904 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/fpcmp-opt.ll

Chris Lattner clattner at apple.com
Thu Jul 8 13:15:36 PDT 2010


On Jul 8, 2010, at 1:12 PM, Evan Cheng wrote:

> Author: evancheng
> Date: Thu Jul  8 15:12:24 2010
> New Revision: 107904
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=107904&view=rev
> Log:
> Check for FiniteOnlyFPMath as well.

Evan, this xform is not target specific.  Is there any reason not to implement it in dag combine?

It also seems really dangerous to me, even for -ffast-math.

-Chris

> 
> Modified:
>    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
>    llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
> 
> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107904&r1=107903&r2=107904&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul  8 15:12:24 2010
> @@ -2295,7 +2295,7 @@
> ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC,
>                              SDValue &ARMCC, SelectionDAG &DAG,
>                              DebugLoc dl) const {
> -  if (UnsafeFPMath &&
> +  if (UnsafeFPMath && FiniteOnlyFPMath() &&
>       (CC == ISD::SETEQ || CC == ISD::SETOEQ ||
>        CC == ISD::SETNE || CC == ISD::SETUNE) &&
>       canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) {
> 
> Modified: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107904&r1=107903&r2=107904&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (original)
> +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Thu Jul  8 15:12:24 2010
> @@ -1,4 +1,4 @@
> -; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math | FileCheck %s
> +; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math -enable-finite-only-fp-math | FileCheck %s
> ; rdar://7461510
> 
> define arm_apcscc i32 @t1(float* %a, float* %b) nounwind {
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list