summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-01-27 19:51:31 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-01-27 19:51:31 +0000
commite2d46d30ae353344cfc3613b2f21cb704566daa3 (patch)
tree301eebd61b42f3a4dee15b3a4f79507bb8348258 /llvm/lib/Transforms
parente801399372bd8083afc8e14e9e4c0bcd992e748a (diff)
downloadbcm5719-llvm-e2d46d30ae353344cfc3613b2f21cb704566daa3.tar.gz
bcm5719-llvm-e2d46d30ae353344cfc3613b2f21cb704566daa3.zip
Expound upon this comparison!
llvm-svn: 124406
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 9abb99d04d3..d8eddab923c 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/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());
}
OpenPOWER on IntegriCloud