[llvm] [BOLT] Add support for safe-icf (PR #116275)

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 13:19:57 PST 2024


================
@@ -350,6 +422,9 @@ Error IdenticalCodeFolding::runOnFunctions(BinaryContext &BC) {
   std::atomic<uint64_t> NumFoldedLastIteration{0};
   CongruentBucketsMap CongruentBuckets;
 
+  auto SkipFuncShared = [&](const BinaryFunction &BF) {
----------------
dcci wrote:

Or you can just modify `shouldOptimize()` to check `isSafeToICF()` if it's general enough

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


More information about the llvm-commits mailing list