[PATCH] D36214: [InstCombine] Remove explicit code for folding (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp).

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 10:18:46 PDT 2017


spatel added a comment.

Double-check to make sure, but I think the sext variant isn't handled if we remove this block (sadly, there's no regression test for it):

define i8 @xor_ext_cmp(i8 %x, i8 %y) {

  %cmp = icmp sgt i8 %x, %y
  %ext = sext i1 %cmp to i8
  %xor = xor i8 %ext, -1
  ret i8 %xor

}

Enhance foldLogicCastConstant() to handle sext? Should we also be calling foldXorOfICmps at the end of foldCastedBitwiseLogic() instead of bailing out there?


https://reviews.llvm.org/D36214





More information about the llvm-commits mailing list