Remove undefined behavior when loading optimal edge profile info.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 3 Sep 2009 07:37:42 +0000 (07:37 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 3 Sep 2009 07:37:42 +0000 (07:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80907 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ProfileInfoLoaderPass.cpp

index 1a2332c0e994bf05869cee7b09a090fe32c1a498..e79dd8c0c22f00e34d2ef8cbdb16b47ea4ae5536 100644 (file)
@@ -159,7 +159,7 @@ void LoaderPass::recurseBasicBlock(const BasicBlock *BB) {
 void LoaderPass::readOrRememberEdge(ProfileInfo::Edge e,
                                     unsigned weight, unsigned ei,
                                     Function *F) {
-  if (weight != (unsigned)MissingValue) {
+  if (weight != ~0U) {
     EdgeInformation[F][e] += weight;
     DEBUG(errs()<<"--Read Edge Counter for " << e 
                 <<" (# "<<ei<<"): "<<(unsigned)getEdgeWeight(e)<<"\n");