[SCEV] ScalarEvolution::createSCEV(): Instruction::Or: drop bogus no-wrap flag detection
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 6 Jun 2020 09:59:58 +0000 (12:59 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 6 Jun 2020 10:02:07 +0000 (13:02 +0300)
commit1eda9bfd6129a0da4cb6e4619d230ab0e08d33f9
tree325ccea8d0420e1e335a5f9893629a0dde994d69
parentc868335e243262876b0db3328f79153bd2d27d00
[SCEV] ScalarEvolution::createSCEV(): Instruction::Or: drop bogus no-wrap flag detection

Summary:
That's just really wrong. While sure, if LHS is AddRec, and we could
propagate it's no-wrap flags, that doesn't make, because as long as
the operands of `or` had no common bits set, then the `add`
of these operands will never overflow: http://volta.cs.utah.edu:8080/z/gmt7Sy
IOW we need no propagation/detection, we are free to just set NUW+NSW.

But as rG39e3683534c83573da5c8b70c8adfb43948f601f shows,
even when the old code failed to "deduce" flags,
we'd eventually re-deduce them somewhere, later.

So let's just set them.

Reviewers: mkazantsev, reames, sanjoy, efriedma

Reviewed By: efriedma

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81246
llvm/lib/Analysis/ScalarEvolution.cpp