[all-commits] [llvm/llvm-project] 56b2ae: [InstCombine] avoid crash from deleting an instruc...

RotateRight via All-commits all-commits at lists.llvm.org
Sun Nov 10 14:41:39 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 56b2aee1875a1ee47ddf859a6584f8728787fb7b
      https://github.com/llvm/llvm-project/commit/56b2aee1875a1ee47ddf859a6584f8728787fb7b
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2019-11-10 (Sun, 10 Nov 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll

  Log Message:
  -----------
  [InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (2nd try)

Re-try rGef02831f0a4e (reverted due to use-after-free), but bail out completely
if we encounter an unexpected llvm.invariant.start.

We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.end.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

Differential Revision: https://reviews.llvm.org/D69977




More information about the All-commits mailing list