 private extension TupleExtractInst {
   var isEltOnlyNonTrivialElt: Bool {
     let function = self.function
-    // If the elt we are extracting is trivial, we cannot be a non-trivial
-    // field... return false.
+
     if type.isTrivial(in: function) {
       return false
     }
 
-    // Ok, we know that the elt we are extracting is non-trivial. Make sure that
-    // we have no other non-trivial elts.
     let opType = operand.type
-    let fieldNo = self.fieldIndex
-
-    // For each element index of the tuple...
-    for (i, eltType) in opType.tupleElements.enumerated() {
-      // If the element index is the one we are extracting, skip it...
-      if i == fieldNo {
-        continue
-      }
-
-      // Otherwise check if we have a non-trivial type. If we don't have one,
-      // continue.
-      if eltType.isTrivial(in: function) {
-        continue
-      }
-
-      // If we do have a non-trivial type, return false. We have multiple
-      // non-trivial types violating our condition.
-      return false
-    }
-
-    // We checked every other elt of the tuple and did not find any
-    // non-trivial elt except for ourselves. Return `true``.
-    return true
+
+    return opType.tupleElements.filter { 
+      !$0.isTrivial(in: function) 
+    }.count == 1
   }
 }
 

}

private func stripRCIdentityPreservingInsts(_ value: Value) -> Value? {
  switch value {
  // First strip off RC identity preserving casts.
  case let inst as Instruction where inst is UpcastInst ||
    inst is UncheckedRefCastInst ||
    inst is InitExistentialRefInst ||
    inst is OpenExistentialRefInst ||
    inst is RefToBridgeObjectInst ||
    inst is BridgeObjectToRefInst ||
    inst is ConvertFunctionInst ||
    inst is UncheckedEnumDataInst:
    return inst.operands[0].value

  // Then if we have a struct_extract that is extracting a non-trivial member


    let structType = operand.type

    return structType.getStructFields(in: function).filter { 
      !$0.isTrivial(in: function)
    }.count == 1
  }
}