[PATCH] D32876: [InstSimplify] add folds for or-of-casted-icmps

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 11:52:37 PDT 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

The sibling folds for 'and' with casts were added with https://reviews.llvm.org/rL273200.
This is a preliminary step for adding the 'or' variants for the folds added with https://reviews.llvm.org/rL301260.

The reason for the strange form with constant LHS in the 1st test is because there's another missing fold in that case for the inverted predicate. That should be fixed when we add the ConstantRange functionality for 'or-of-icmps' that already exists for 'and-of-icmps'.

I'm not sure yet why the vector constant expression is not simplified in the 2nd test.

I'm hoping to share more code for the and/or cases, so we won't have these differences. This will allow us to remove code from InstCombine. It's also possible that we can remove some code here in InstSimplify. I think we have some duplicated folds because patterns are not matched in a general way.


https://reviews.llvm.org/D32876

Files:
  lib/Analysis/InstructionSimplify.cpp
  test/Transforms/InstSimplify/AndOrXor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32876.97856.patch
Type: text/x-patch
Size: 5993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170504/469f585f/attachment.bin>


More information about the llvm-commits mailing list