[PATCH] D112258: Add test to check we can instcombine after reassociate. NFC.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 12:09:12 PDT 2021


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM - feel free to add tests without pre-commit review.
I would add the 'or' variant of this pattern too for completeness:

  define i32 @not_reassociate_or_or_not(i32 %a, i32 %b, i32 %c, i32 %d) {
    %notb = xor i32 %b, -1
    %notc = xor i32 %c, -1
    %b1 = or i32 %a, %notb
    %b2 = or i32 %b1, %d
    %b3 = or i32 %b2, %notc
    ret i32 %b3
  }



================
Comment at: llvm/test/Transforms/PhaseOrdering/reassociate-instcombine.ll:4
+
+; Make sure we reassociate and1 with and2 before instcombine to siplify
+; (a & ~b) & ~c --> a & ~(b | c)
----------------
siplify -> "allow Demorgan logic fold" ?



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112258/new/

https://reviews.llvm.org/D112258



More information about the llvm-commits mailing list