This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Don't allow addcarry if the type of the carry producer is illegal.
ClosedPublic

Authored by jonpa on Mar 26 2019, 7:53 AM.

Details

Summary

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.

Diff Detail

Event Timeline

jonpa created this revision.Mar 26 2019, 7:53 AM
spatel accepted this revision.Mar 26 2019, 11:42 AM

LGTM

test/CodeGen/SystemZ/dag-combine-05.ll
9–10

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.

This revision is now accepted and ready to land.Mar 26 2019, 11:42 AM
jonpa closed this revision.Mar 27 2019, 1:47 AM
jonpa marked an inline comment as done.

Thanks for review! Test case updated per suggestion.

r357052