[InstCombine] Avoid iteration/mutation conflict
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 15 Jun 2018 16:52:40 +0000 (16:52 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 15 Jun 2018 16:52:40 +0000 (16:52 +0000)
commit6f406d4f022e059033b335bc024d0c652d6d8c52
tree0d7be596ce250ed81d9b04ccd6ed9ec615f7eaed
parent4adf24502ec8c993e3da2fe0ad2f4921e5a76bb9
[InstCombine] Avoid iteration/mutation conflict

Summary:
When iterating users of a multiply in processUMulZExtIdiom, the
call to setOperand in the truncation case may replace the use
being visited; make sure the iterator has been advanced before
doing that replacement.

Reviewers: majnemer, davide

Reviewed By: davide

Subscribers: llvm-commits

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

llvm-svn: 334844
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-mul-zext.ll