[PATCH] D119266: [SimplifyCFG] Do not merge landingpads for invokes with deopt state.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 11:08:32 PST 2022


lebedev.ri added a reviewer: lebedev.ri.
lebedev.ri added a comment.

I'm not sure i understand why this is required. Going through all the invokes
and ensuring that every `deopt` `invoke` has a dedicated (empty) `landingpad`
seems both trivial to do and something that you'd want to do a part of lowering later on anyway?.



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6659
+  // for such invokes.
+  BasicBlock *Pred = *pred_begin(BB);
+  if (auto *Invoke = dyn_cast<InvokeInst>(Pred->getTerminator()))
----------------
Why is only the first predecessor checked?


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6660
+  BasicBlock *Pred = *pred_begin(BB);
+  if (auto *Invoke = dyn_cast<InvokeInst>(Pred->getTerminator()))
+    if (Invoke->getOperandBundle(LLVMContext::OB_deopt))
----------------
Can `landingpad` has any other predecessor than an `invoke`?


================
Comment at: llvm/test/Transforms/SimplifyCFG/duplicate-landingpad.ll:1
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
----------------
Please use the script.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119266



More information about the llvm-commits mailing list