[PATCH] D95019: [ConstantHoisting] Fix bug where constant materialization could insert into EH pad

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 13:19:36 PST 2021


rnk added a comment.

Out of curiosity, have you bisected this to a particular change?



================
Comment at: llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:190
+  if (Idx != ~0U && isa<PHINode>(Inst)) {
+    auto InsertionBlock = cast<PHINode>(Inst)->getIncomingBlock(Idx);
+    if (!InsertionBlock->isEHPad()) {
----------------
Are you sure you meant to shadow the outer variable here? InsertionBlock will be null in the case you are trying to handle, a phi, preceded by a catchswitch, and I'm not sure what `DT->getNode(nullptr)` returns.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95019



More information about the llvm-commits mailing list