[PATCH] D22601: [SCCP] Mark constant xor %blah, %blah even if the lattice value is overdefined

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 13:04:38 PDT 2016


davide added a comment.

In https://reviews.llvm.org/D22601#491764, @eli.friedman wrote:

> The transformation valid... but I don't think it makes sense to perform it here. SCCP doesn't add any power to the transformation over instsimplify.


I was worried about that. We already do some similar transformations in visitBinaryOp()

  if (I.getOpcode() == Instruction::And) {
    // X and 0 = 0
    if (NonOverdefVal->getConstant()->isNullValue())
      return markConstant(IV, &I, NonOverdefVal->getConstant());
  } else {
    if (ConstantInt *CI = NonOverdefVal->getConstantInt())
      if (CI->isAllOnesValue())     // X or -1 = -1
        return markConstant(IV, &I, NonOverdefVal->getConstant());
  }

maybe we should get rid of these?


https://reviews.llvm.org/D22601





More information about the llvm-commits mailing list