diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-01-27 19:51:31 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-01-27 19:51:31 +0000 |
commit | c9d69489ebe12f265828c48defb0278f6bd9121f (patch) | |
tree | 05d4637797254886e846114ed2c5d6387227549a /lib/Transforms/IPO/MergeFunctions.cpp | |
parent | dfc597297484736ac939efe4c233e7c10ce8ad29 (diff) |
Expound upon this comparison!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/MergeFunctions.cpp')
-rw-r--r-- | lib/Transforms/IPO/MergeFunctions.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/MergeFunctions.cpp b/lib/Transforms/IPO/MergeFunctions.cpp index 9abb99d04d..d8eddab923 100644 --- a/lib/Transforms/IPO/MergeFunctions.cpp +++ b/lib/Transforms/IPO/MergeFunctions.cpp @@ -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()); } |