diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/test/CodeGen/ARM/fpcmp-opt.ll | 2 | 
2 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index e3db5832980..8ca69cd6122 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -2295,11 +2295,13 @@ SDValue  ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC,                               SDValue &ARMCC, SelectionDAG &DAG,                               DebugLoc dl) const { -  if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || +  if (UnsafeFPMath && +      (CC == ISD::SETEQ || CC == ISD::SETOEQ ||         CC == ISD::SETNE || CC == ISD::SETUNE) &&        canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { -    // If there are no othter uses of the CMP operands, and the condition -    // code is EQ oe NE, we can optimize it to an integer comparison. +    // If unsafe fp math optimization is enabled and there are no othter uses of +    // the CMP operands, and the condition code is EQ oe NE, we can optimize it +    // to an integer comparison.      if (CC == ISD::SETOEQ)        CC = ISD::SETEQ;      else if (CC == ISD::SETUNE) diff --git a/llvm/test/CodeGen/ARM/fpcmp-opt.ll b/llvm/test/CodeGen/ARM/fpcmp-opt.ll index ed515cc1e7c..f651c167cc7 100644 --- a/llvm/test/CodeGen/ARM/fpcmp-opt.ll +++ b/llvm/test/CodeGen/ARM/fpcmp-opt.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s +; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math | FileCheck %s  ; rdar://7461510  define arm_apcscc i32 @t1(float* %a, float* %b) nounwind {  | 

