[llvm] r272873 - SimplifyCFG is able to detect the pattern:

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 07:16:10 PDT 2016


On Thu, Jun 16, 2016 at 04:44:26AM -0000, Chuang-Yu Cheng via llvm-commits wrote:
> Author: cycheng
> Date: Wed Jun 15 23:44:25 2016
> New Revision: 272873
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=272873&view=rev
> Log:
> SimplifyCFG is able to detect the pattern:
>     (i == 5334 || i == 5335)
> to:
>     ((i & -2) == 5334)
> 
> This transformation has some incorrect side conditions. Specifically, the
> transformation is only applied when the right-hand side constant (5334 in
> the example) is a power of two not equal and not equal to the negated mask.
> These side conditions were added in r258904 to fix PR26323. The correct side
> condition is that: ((Constant & Mask) == Constant)[(5334 & -2) == 5334].

Does this problem apply to the 3.8 release as well?

Joerg


More information about the llvm-commits mailing list