[PATCH] D33172: [InstCombine] Simpify inverted predicates in 'or'

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 09:05:52 PDT 2017


spatel added a comment.

A couple of updates:

1. Added the tests included here to show the current IR with: https://reviews.llvm.org/rL303133 / https://reviews.llvm.org/rL303185

2. Refactored some code that may be relevant for this transform:

https://reviews.llvm.org/rL303261

I think the predicate canonicalization that we do for icmp+branch is worthwhile because it increases the likelihood of creating duplicate values (fcmp needs fixes IMO). It also can make pattern matching for other transforms easier if we know that half of the possible predicates are eliminated by canonicalization (at least for the single-use case). For the same reasons, I favor making that canonicalization apply to cmp+select as well. Ie, I would invert the predicates / swap the select operands shown in the tests here. This probably requires preliminary patches to avoid regressions though.


https://reviews.llvm.org/D33172





More information about the llvm-commits mailing list