[PATCH] D47922: unsigned foo(unsigned x, unsigned y) { return x > y && x != 0; } should fold to x > y

Li Jia He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 23:58:43 PDT 2018


HLJ2009 added inline comments.


================
Comment at: test/Transforms/InstCombine/and3.ll:4
+
+; x > y && x != 0 -> x > y
+
----------------
lebedev.ri wrote:
> HLJ2009 wrote:
> > lebedev.ri wrote:
> > > Can you place it next to the rest of the tests from `simplifyUnsignedRangeCheck()`?
> > Yes, I want to do it. However I've looked for a test file specific to simplifyUnsignedRangeCheck, but I didn't find it. If possible, I can add the remaining test cases for simplifyUnsignedRangeCheck
> Cripple that function:
> ```
> static Value *simplifyUnsignedRangeCheck(ICmpInst *ZeroICmp,
>                                          ICmpInst *UnsignedICmp, bool IsAnd) {
>   return nullptr;
> ...
> }
> ```
> and look through the tests that are now failing.
> I think it might be `test/Transforms/InstCombine/range-check.ll`.
Thank you very much for pointing this out. I'll update it soon.


Repository:
  rL LLVM

https://reviews.llvm.org/D47922





More information about the llvm-commits mailing list