Update the branch weight metadata in JumpThreading pass.
[oota-llvm.git] / lib / Analysis / BlockFrequencyInfoImpl.cpp
index 903a263a65fee860def7cd346f5c107524fecbf0..48e23af2690a729f5e862a5d5caf1d0a78b5e5fc 100644 (file)
@@ -530,6 +530,13 @@ BlockFrequencyInfoImplBase::getFloatingBlockFreq(const BlockNode &Node) const {
   return Freqs[Node.Index].Scaled;
 }
 
+void BlockFrequencyInfoImplBase::setBlockFreq(const BlockNode &Node,
+                                              uint64_t Freq) {
+  assert(Node.isValid() && "Expected valid node");
+  assert(Node.Index < Freqs.size() && "Expected legal index");
+  Freqs[Node.Index].Integer = Freq;
+}
+
 std::string
 BlockFrequencyInfoImplBase::getBlockName(const BlockNode &Node) const {
   return std::string();