[SimplifyCFG] Constant fold a branch implied by it's incoming edge
authorPhilip Reames <listmail@philipreames.com>
Thu, 29 Oct 2015 03:11:49 +0000 (03:11 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 29 Oct 2015 03:11:49 +0000 (03:11 +0000)
commitc9f72585e869e84099f8b5c58ddb2977931234c2
tree38e719666c6a0eb83b76e9a78d48d1affb4b2925
parent12c4ab6c8388e38ff0db4ab9dd0efa0196a3e07e
[SimplifyCFG] Constant fold a branch implied by it's incoming edge

The most common use case is when eliminating redundant range checks in an example like the following:
c = a[i+1] + a[i];

Note that all the smarts of the transform (the implication engine) is already in ValueTracking and is tested directly through InstructionSimplify.

Differential Revision: http://reviews.llvm.org/D13040

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251596 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/implied-cond.ll [new file with mode: 0644]