Revise per review comments.
authorDale Johannesen <dalej@apple.com>
Sun, 26 Aug 2007 01:18:27 +0000 (01:18 +0000)
committerDale Johannesen <dalej@apple.com>
Sun, 26 Aug 2007 01:18:27 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41409 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index acee98415855b4d6ee29c12d79679ff161018fa3..fed77a53ce6262a58dd660f364771b358ed1aaf5 100644 (file)
@@ -1154,7 +1154,7 @@ protected:
              getSDVTList(VT)), 
              Value(VT==MVT::f64 ? APFloat(val) : APFloat((float)val)) {
   }
-  ConstantFPSDNode(bool isTarget, APFloat val, MVT::ValueType VT)
+  ConstantFPSDNode(bool isTarget, const APFloat& val, MVT::ValueType VT)
     : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
              getSDVTList(VT)), Value(val) {
   }
@@ -1168,7 +1168,7 @@ public:
     else
       return Value.convertToFloat();
   }
-  APFloat getValueAPF() const { return Value; }
+  const APFloat& getValueAPF() const { return Value; }
 
   /// isExactlyValue - We don't rely on operator== working on double values, as
   /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
@@ -1180,7 +1180,7 @@ public:
     else
       return isExactlyValue(APFloat((float)V));
   }
-  bool isExactlyValue(APFloat V) const;
+  bool isExactlyValue(const APFloat& V) const;
 
   static bool classof(const ConstantFPSDNode *) { return true; }
   static bool classof(const SDNode *N) {
index 2b119a095aa3717dd6d489f520542b3a0b456865..fda0589a6de4de2662af49310ca00be5c9126efb 100644 (file)
@@ -3195,7 +3195,7 @@ SDOperand DAGCombiner::visitFCOPYSIGN(SDNode *N) {
     return DAG.getNode(ISD::FCOPYSIGN, VT, N0, N1);
   
   if (N1CFP) {
-    APFloat V = N1CFP->getValueAPF();
+    const APFloat& V = N1CFP->getValueAPF();
     // copysign(x, c1) -> fabs(x)       iff ispos(c1)
     // copysign(x, c1) -> fneg(fabs(x)) iff isneg(c1)
     if (!V.isNegative())
index 4bd07b60b7f467f784c67d282a8ed680e2a065fe..055834b503932d2c1fcd5d099869d7ba9e0f638f 100644 (file)
@@ -48,7 +48,7 @@ static SDVTList makeVTList(const MVT::ValueType *VTs, unsigned NumVTs) {
 /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
 /// As such, this method can be used to do an exact bit-for-bit comparison of
 /// two floating point values.
-bool ConstantFPSDNode::isExactlyValue(APFloat V) const {
+bool ConstantFPSDNode::isExactlyValue(const APFloat& V) const {
   return Value.bitwiseIsEqual(V);
 }