================
@@ -151,15 +151,9 @@ void verifyMisExpect(Instruction &I, ArrayRef<uint32_t> 
RealWeights,
   uint64_t TotalBranchWeight =
       LikelyBranchWeight + (UnlikelyBranchWeight * NumUnlikelyTargets);
 
-  // FIXME: When we've addressed sample profiling, restore the assertion
-  //
-  // We cannot calculate branch probability if either of these invariants 
aren't
-  // met. However, MisExpect diagnostics should not prevent code from 
compiling,
-  // so we simply forgo emitting diagnostics here, and return early.
-  // assert((TotalBranchWeight >= LikelyBranchWeight) && (TotalBranchWeight > 
0)
-  //              && "TotalBranchWeight is less than the Likely branch 
weight");
-  if ((TotalBranchWeight == 0) || (TotalBranchWeight <= LikelyBranchWeight))
-    return;
+  // Failing this assert means that we have corrupted metadata.
+  assert((TotalBranchWeight >= LikelyBranchWeight) && (TotalBranchWeight > 0) 
&&
----------------
ilovepi wrote:

it was introduced after we found an issue w/ thinLTO, since sample profiling 
can run multiple times. We then introduced an early return to avoid division by 
zero, but now it should be safe to just use the assert, since we should only 
ever process branches w/ the provenance tag.

for now, I guess let's leave it as an assert, since I don't expect it to fire, 
and users don't have control of it.

https://github.com/llvm/llvm-project/pull/86610
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to