OSDN Git Service

[CodeGenPrepare] Fix zapping dead operands of assume
authorYevgeny Rouban <yrouban@azul.com>
Mon, 14 Sep 2020 04:42:23 +0000 (11:42 +0700)
committerYevgeny Rouban <yrouban@azul.com>
Mon, 14 Sep 2020 04:46:34 +0000 (11:46 +0700)
commit88690a965892e82cac05a162a9d10e2ce4e2355f
tree39a41dc1fd6b3e83e8faebdda6cfb72a581ef939
parent6e42cadf106ccdc7759dd8af113ecf797220de47
[CodeGenPrepare] Fix zapping dead operands of assume

This patch fixes a problem of the commit 52cc97a0.
A test case is created to demonstrate the crash caused by
the instruction iterator invalidated by the recursive
removal of dead operands of assume. The solution restarts
from the blocks's first instruction in case CurInstIterator
is invalidated by RecursivelyDeleteTriviallyDeadInstructions().

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D87434
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/X86/recursively-delete-dead-instructions.ll [new file with mode: 0644]