[WideableCond] Fix a nasty bug in detection of "explicit guards"
authorPhilip Reames <listmail@philipreames.com>
Tue, 2 Apr 2019 16:51:43 +0000 (16:51 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 2 Apr 2019 16:51:43 +0000 (16:51 +0000)
commitd3d5d76a7b7e8c0cfcb21a37b2fd9b4b2a67a0b8
tree26d6a995d3d23d9b9f35a36316cd4e1d687c83d7
parent017deaf1ae3aa84211a416a37e2c895a18c2a5e3
[WideableCond] Fix a nasty bug in detection of "explicit guards"

The code was failing to actually check for the presence of the call to widenable_condition.  The whole point of specifying the widenable_condition intrinsic was allowing widening transforms.  A normal branch is not widenable.  A normal branch leading to a deopt is not widenable (in general).

I added a test case via LoopPredication, but GuardWidening has an analogous bug.  Those are the only two passes actually using this utility just yet. Noticed while working on LoopPredication for non-widenable branches; POC in D60111.

llvm-svn: 357493
llvm/lib/Analysis/GuardUtils.cpp
llvm/test/Transforms/LoopPredication/basic_widenable_branch_guards.ll