[PATCH] D47878: [DAGCombiner] Fix for PR37667

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 07:19:16 PDT 2018


spatel added a comment.

I'm not familiar with this transform, but the proposal makes sense. But I think it would be easier to follow the logic if it was written as:

  // Also ensure that the node to be masked only produces one data result.
  NodeToMask = Op.getNode();
  unsigned DataValues = 0;
  for (unsigned i = 0; i < NodeToMask->getNumValues(); ++i) {
    MVT VT = SDValue(NodeToMask, i).getSimpleValueType();
    if (VT != MVT::Glue && VT != MVT::Other)
      ++DataValues;
    if (DataValues > 1) {
      NodeToMask = nullptr;
      return false;
    }
  }
  assert(DataValues == 1 && "Node to be masked has no data result?");

Also, I added tests for both bugs (just in case there was logic difference there) with https://reviews.llvm.org/rL334199. Please use utils/update_llc_test_checks.py to update the assertions and rebase here.


https://reviews.llvm.org/D47878





More information about the llvm-commits mailing list