[llvm-branch-commits] [NFC][IndirectCallProm] Refactor function-based conditional devirtualization and indirect call value profile update into one helper function (PR #80762)

Teresa Johnson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 7 16:34:23 PST 2024


================
@@ -287,7 +290,18 @@ uint32_t IndirectCallPromoter::tryToPromote(
     NumOfPGOICallPromotion++;
     NumPromoted++;
   }
-  return NumPromoted;
+
+  const bool Changed = (NumPromoted != 0);
----------------
teresajohnson wrote:

Just return false early if NumPromoted is 0 (then Changed can be removed and just return true at the end further below).

https://github.com/llvm/llvm-project/pull/80762


More information about the llvm-branch-commits mailing list