OSDN Git Service

ConstantFolding: Avoid a crash.
authorManoj Gupta <manojgupta@google.com>
Mon, 23 Jul 2018 21:20:00 +0000 (21:20 +0000)
committerManoj Gupta <manojgupta@google.com>
Mon, 23 Jul 2018 21:20:00 +0000 (21:20 +0000)
commit7321ba268a1be7fab16e82d93bd42f9b3a90eb36
tree7a9d10432d57bf0fe42f5818c7d9d7bde50754d8
parentd3db945575b2ea5a11e0bf304e17590ead7bc795
ConstantFolding: Avoid a crash.

Summary:
Check if the parent basic block and caller exists
before calling CS.getCaller when constant folding
strip.invariant.group instrinsic.

This avoids a crash when the function containing the intrinsic
is being inlined. The instruction is checked for any simplifiction
but has not yet been added to a basic block.

Reviewers: Prazek, rsmith, efriedma

Reviewed By: efriedma

Subscribers: eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337742 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ConstantFolding.cpp
test/Transforms/Inline/inline_inv_group.ll [new file with mode: 0644]