[PATCH] D140160: [llvm][SelectionDAGBuilder] codegen callbr.landingpad intrinsic
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 25 10:47:08 PST 2023
jyknight added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:44
+static bool isUsedOutsideOfDefiningBlock(const CallBrInst *CBR) {
+ return llvm::any_of(CBR->getIndirectDests(), [](BasicBlock *Dest) {
----------------
It's unfortunate to need to special case this. Perhaps the intrinsic should take the callbr's output value as an input -- instead of magically "poofing" its value into existence by looking at the terminating instruction of the predecessor block? Then this code could be deleted, I believe.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2127
if (VMI != FuncInfo.ValueMap.end()) {
- assert(!V->use_empty() && "Unused value assigned virtual registers!");
+ assert((!V->use_empty() || isa<CallBrInst>(V)) &&
+ "Unused value assigned virtual registers!");
----------------
This change could also be reverted in that case I think, because it'd no longer appear spuriously unused.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140160/new/
https://reviews.llvm.org/D140160
More information about the llvm-commits
mailing list