[PATCH] D96372: [CodeGen] Split out cold exception handling pads.

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 16:13:57 PST 2021


rahmanl added a comment.

Thanks.
LGTM with minor nits.



================
Comment at: llvm/lib/CodeGen/MachineFunctionSplitter.cpp:138
+  bool HasHotLandingPads = false;
+  for (const auto &LP : LandingPads) {
+    if (!isColdBlock(*LP, MBFI, PSI))
----------------
"Use auto & for values and auto * for pointers unless you need to make a copy."
You might as well consider spelling out the type here since the type is not really obvious from this line.


================
Comment at: llvm/lib/CodeGen/MachineFunctionSplitter.cpp:143
+  if (!HasHotLandingPads) {
+    for (auto &LP : LandingPads)
+      LP->setSectionID(MBBSectionID::ColdSectionID);
----------------
Same as above.


================
Comment at: llvm/test/CodeGen/X86/machine-function-splitter.ll:206
+
+hot:
+  %2 = call i32 @bar()
----------------
nit: You can reuse this for the previous test case (the case where all landing pads are cold). You can still have two landing pads and make one of them configurable with a macro.
```
hot:
  %2 = call i32 @bar()
  invoke void @_Z1fv()
          to label %exit unwind label %lpad2, !prof ![[PROF]]
```

Just a suggestion. Using macros could make tests less readable too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96372/new/

https://reviews.llvm.org/D96372



More information about the llvm-commits mailing list