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

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 17:33:38 PST 2024


================
@@ -817,6 +820,12 @@ class BinaryFunction {
     return nullptr;
   }
 
+  /// Indicates if the function is safe to fold.
+  bool isSafeToICF() const { return IsSafeToICF; }
+
+  /// Sets the function is not safe to fold.
+  void setUnsafeICF() { IsSafeToICF = false; }
----------------
dcci wrote:

A better interface might be `setSafeICF(bool isSafe)`, maybe. I'll let @maksfb comment.

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


More information about the llvm-commits mailing list