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

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 20:48:03 PST 2024


================
@@ -27,15 +28,74 @@ class IdenticalCodeFolding : public BinaryFunctionPass {
       return false;
     if (BF.hasSDTMarker())
       return false;
+    if (BF.hasAddressTaken())
+      return false;
     return BinaryFunctionPass::shouldOptimize(BF);
   }
 
 public:
+  enum class ICFLevel {
+    None, // No ICF. (Default)
+    Safe, // Safe ICF for all sections.
+    All,  // Aggressive ICF for code.
----------------
maksfb wrote:

For automatic doc generation (doxygen), you can use "///". The last two comments are confusing as one says "for all sections" and the other - "for code".

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


More information about the llvm-commits mailing list