[PATCH] D53887: [HotColdSplitting] [WIP] Outline more than once per function

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 11:22:45 PST 2018


junbuml added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/HotColdSplitting.cpp:511
+      LLVM_DEBUG(dbgs() << "Entire function is cold\n");
+      return markEntireFunctionCold(F);
+    }
----------------
hiraditya wrote:
> junbuml wrote:
> > I don't think it's good idea to add MinSize in this case. It is possible that a hot function or main() itself can be successfully ended up with exit(0). 
> The static analysis here is pretty conservative, unless the runtime-profile information is broken, it seems unlikely that this pass will mark a hot function as cold.
I agree that this pass will unlikely mark hot blocks as cold. But, in line 509~511, it mark MinSize on the function, if all blocks are post-domed by a single cold block (e.g., mark-the-whole-func-cold.ll). In the example below, we may not want to mark MinSize on main(). 

```
void main() {
  // .. 
  // hot loop .. 
  // 
  exit (0);
}

```


https://reviews.llvm.org/D53887





More information about the llvm-commits mailing list