For both operands are unsigned, add the following optimization test case.

- X > Y && X != 0 --> X > Y
- X > Y || X != 0 --> X != 0
- X <= Y || X != 0 --> true
- X <= Y || X == 0 --> X <= Y
- X > Y && X == 0 --> false

Differential D47972

update simplifyUnsignedRangeCheck function's test case.

Authored by **HLJ2009** on Jun 8 2018, 7:03 PM.

Details

- Reviewers
spatel craig.topper lebedev.ri

For both operands are unsigned, add the following optimization test case.

- X > Y && X != 0 --> X > Y
- X > Y || X != 0 --> X != 0
- X <= Y || X != 0 --> true
- X <= Y || X == 0 --> X <= Y
- X > Y && X == 0 --> false

Diff Detail

- Repository
- rL LLVM
- Build Status
**Buildable 19126**Build 19126: arc lint + arc unit

Comment Actions

Adding Roman as reviewer - do these tests answer the questions from D47922 about whether the existing transform is miscompiling or just incomplete?

Comment Actions

@HLJ2009 just in case, let me reiterate:

These tests need to be generated for the **svn trunk** version of llvm, **not** D47922.

They should be (when accepted) **committed before** the dependent revision.

They need to have good coverage, ideally for all the previously-missing cases, and for **all the cases that will be affected** by the dependent revision. (well, not *all*, obviously)

Then, D47922 needs to be rebased **ontop of this change** (and do mark it as a dependent in phabricator, to signify it), and the effect of the code change should be visible in the tests.