[InstCombine] Widen guards with conditions between
authorPhilip Reames <listmail@philipreames.com>
Wed, 9 May 2018 22:56:32 +0000 (22:56 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 9 May 2018 22:56:32 +0000 (22:56 +0000)
commit79e917d117b9caec749360614795cd857c21419a
treeebf9eb445da79772a1d8a83e5eb93355d2d1d2cb
parentb11f8b3cbc714fd9977d72cce04bb5fec25e3378
[InstCombine] Widen guards with conditions between

The previous handling for guard widening in InstCombine was extremely restrictive. In particular, it didn't handle the common case where we had two guards separated by a single icmp. Handle this by scanning through a small fixed window of instructions to find the next guard if needed.

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

llvm-svn: 331935
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/call-guard.ll