[llvm-commits] [llvm] r107856 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/fpcmp-opt.ll
Evan Cheng
evan.cheng at apple.com
Wed Jul 7 23:01:49 PDT 2010
Author: evancheng
Date: Thu Jul 8 01:01:49 2010
New Revision: 107856
URL: http://llvm.org/viewvc/llvm-project?rev=107856&view=rev
Log:
r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.
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=107856&r1=107855&r2=107856&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul 8 01:01:49 2010
@@ -2295,11 +2295,13 @@
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)
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=107856&r1=107855&r2=107856&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Thu Jul 8 01:01:49 2010
@@ -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 {
More information about the llvm-commits
mailing list