[PATCH] D42067: [SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean return value

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 10:28:39 PST 2018


uweigand added a comment.

In https://reviews.llvm.org/D42067#977202, @RKSimon wrote:

> > (I don't have a stand-alone test case for this, but this patch is required to make a test case pass that I'll be adding with a follow-on SystemZ back-end patch.)
>
> Do have you the follow up patch available that you could make dependent on this one to show the diff?


I somehow wasn't able to create a dependent diff, but I uploaded the back-end patch (set) here:
https://reviews.llvm.org/D42115

Most of the new tests added to tests/SystemZ/cmpxchg-* will fail without this patch.  In the end, this is because I want to fold tests of the success result of compare-and-swap operations into a conditional branch using the condition code set by the CSG instruction directly.  But standard expansion in SelectionDAG for some reason always creates an AND with 1 when using the success result, and the presence of this AND messes up my pattern matchers.  But with this patch, common code knows that this AND is redundant and we can get rid of it.


Repository:
  rL LLVM

https://reviews.llvm.org/D42067





More information about the llvm-commits mailing list