[llvm-commits] [llvm] r124406 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Nick Lewycky nicholas at mxc.ca
Thu Jan 27 11:51:31 PST 2011


Author: nicholas
Date: Thu Jan 27 13:51:31 2011
New Revision: 124406

URL: http://llvm.org/viewvc/llvm-project?rev=124406&view=rev
Log:
Expound upon this comparison!

Modified:
    llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=124406&r1=124405&r2=124406&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Jan 27 13:51:31 2011
@@ -468,6 +468,8 @@
     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());
   }





More information about the llvm-commits mailing list