getAsCarry() checks that the input argument is a carry-producing node before allowing a transformation to addcarry. This patch adds a check to make sure that the carry-producing node is legal. If it is not, it may not remain in a form that is manageable by the backend. The test case causes a compilation failure during instruction selection for this reason on SystemZ.
DAGCombine.cpp patch Patch by Ulrich Weigand.
It's better to use positive CHECK lines so we know the result is correct rather than only 'not wrong'.
'utils/update_llc_test_checks.py' should be fine to use here.