[PATCH] D69977: [InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 14:43:19 PST 2019


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2397
+        // the list element to avoid examining in the next loop.
+        if (II->getIntrinsicID() == Intrinsic::invariant_start) {
+          if (II->hasNUsesOrMore(2))
----------------
efriedma wrote:
> Is it not too late here?  I would have thought we need to check in isAllocSiteRemovable.
I'm not imagining how it would fail, but checking sooner definitely seems more efficient than nested loops. Will change.


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

https://reviews.llvm.org/D69977





More information about the llvm-commits mailing list