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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 09:20:32 PDT 2017


craig.topper added a comment.

I don't believe https://reviews.llvm.org/D32725 won't do anything to the patch with globals in it. I don't believe an xor ever exists there.

I think the globals test is somehow different do to the presence of the loads of the globals that don't exist in the argument test.

I've been wondering if there's some way to canonicalize (br (and cmp ne, cmp ne) and (br (or cmp eq, cmp eq)) to the same thing by inverting the branch targets in one which would allow CSE to catch it. But I think it gets difficult when there are more than 2 compares involved that need to be canonicalized since you need to walk a tree to make sure you can flip all the compares.


https://reviews.llvm.org/D35182





More information about the llvm-commits mailing list