Expound upon this comparison!
authorNick Lewycky <nicholas@mxc.ca>
Thu, 27 Jan 2011 19:51:31 +0000 (19:51 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 27 Jan 2011 19:51:31 +0000 (19:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124406 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/MergeFunctions.cpp

index 9abb99d04d36fd5e0ee0336e21975bb66b462acf..d8eddab923c99e8ed4dfbe116afd25825de8aa1d 100644 (file)
@@ -468,6 +468,8 @@ bool FunctionComparator::Enumerate(const Value *V1, const Value *V2) {
     if (C1->isNullValue() && C2->isNullValue() &&
        isEquivalentType(C1->getType(), C2->getType()))
       return true;
+    // Try bitcasting C2 to C1's type. If the bitcast is legal and returns C1
+    // then they must have equal bit patterns.
     return C1->getType()->canLosslesslyBitCastTo(C2->getType()) &&
       C1 == ConstantExpr::getBitCast(const_cast<Constant*>(C2), C1->getType());
   }