[PATCH] D35182: [InstCombine] remove one-use restriction for not (cmp P, A, B) --> cmp P', A, B

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 09:55:48 PDT 2017


spatel added a comment.

In https://reviews.llvm.org/D35182#803754, @craig.topper wrote:

> Are any of the improved tests, cases that wouldn't be improved by my earlier proposal to demorgan logical ops on compare when one side is free to invert and the other side isn't. Which I think avoids the CSE issues.


I was wondering about that too. You're referring to https://reviews.llvm.org/D32725? We're getting the same outcome on the SimplifyCFG tests - 'test_simple' and 'test_recursive', but yes, we have the CSE-related diff on 'test_simple_commuted'.



================
Comment at: test/Transforms/SimplifyCFG/merge-cond-stores.ll:45
 ; CHECK-NEXT:    br i1 [[TMP0]], label [[TMP1:%.*]], label [[TMP2:%.*]]
-; CHECK:         [[DOT:%.*]] = zext i1 [[X2]] to i32
+; CHECK:         [[X3:%.*]] = icmp eq i32 [[B:%.*]], 0
+; CHECK-NEXT:    [[DOT:%.*]] = zext i1 [[X3]] to i32
----------------
craig.topper wrote:
> This test also got worse, but I guess it will CSE too?
Right - we'd expect X3 to be matched with X2 and deleted by -early-cse.


https://reviews.llvm.org/D35182





More information about the llvm-commits mailing list