OSDN Git Service

[MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed more...
authorXin Tong <trent.xin.tong@gmail.com>
Wed, 28 Feb 2018 12:08:00 +0000 (12:08 +0000)
committerXin Tong <trent.xin.tong@gmail.com>
Wed, 28 Feb 2018 12:08:00 +0000 (12:08 +0000)
commit5de243758f75aee7484d76e72d114f9c225d56d4
tree0a5a751473ee2016b9cc406babc610ad98584673
parent33f95e74032d4c7a13a98c2113dba67452fef3db
[MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed more than once.

Summary:
Fix a bug in MergeICmp that can lead to a BCECmp block being processed more than once and eventually lead to a broken LLVM module.
The problem is that if the non-constant value is not produced by the last block, the producer will be processed once when the its parent block
is processed and second time when the last block is processed.

We end up having 2 same BCECmpBlock in the merge queue. And eventually lead to a broken LLVM module.

Reviewers: courbet, davide

Reviewed By: courbet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326318 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/MergeICmps.cpp
test/Transforms/MergeICmps/X86/last-block-produce-no-value.ll [new file with mode: 0644]