[PATCH] D23082: [AutoFDO] Fix handling of empty profiles

David Callahan via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 13:26:56 PDT 2016


david2050 updated this revision to Diff 66542.
david2050 added a comment.

fix formatting


https://reviews.llvm.org/D23082

Files:
  lib/IR/Function.cpp

Index: lib/IR/Function.cpp
===================================================================
--- lib/IR/Function.cpp
+++ lib/IR/Function.cpp
@@ -1262,7 +1262,10 @@
     if (MDString *MDS = dyn_cast<MDString>(MD->getOperand(0)))
       if (MDS->getString().equals("function_entry_count")) {
         ConstantInt *CI = mdconst::extract<ConstantInt>(MD->getOperand(1));
-        return CI->getValue().getZExtValue();
+        uint64_t Count = CI->getValue().getZExtValue();
+        if (Count == 0)
+          return None;
+        return Count;
       }
   return None;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23082.66542.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160802/636f1550/attachment.bin>


More information about the llvm-commits mailing list