This is an archive of the discontinued LLVM Phabricator instance.

[X86] When handling addcarry intrinsic, create the flag result with the correct type so we don't crash if we use a memory instruction
ClosedPublic

Authored by craig.topper on Aug 12 2017, 11:04 AM.

Details

Summary

Previously we were creating the flag result with MVT::Other which is interpretted as a Chain node. If we used a memory form of the instruction we would end up with a copyToReg that consumed the chain result of the adcx instruction instead of the flag result.

Pretty sure we should be using MVT::i32 here, that's what we do other places we create these node types.

We should probably consider this for 5.0 as well.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 12 2017, 11:04 AM
RKSimon edited edge metadata.Aug 12 2017, 11:11 AM

Is this PR33229?

I was seeing a different stack trace than PR33229, but I'll check it out.

Looks like it fixes PR33229. Probably will fix PR24943, PR22571 as well.

RKSimon accepted this revision.Aug 12 2017, 12:54 PM

Looks like it fixes PR33229. Probably will fix PR24943, PR22571 as well.

LGTM with additional test cases that covers all of these as well.

I agree this should probably be merged into 5.0.

This revision is now accepted and ready to land.Aug 12 2017, 12:54 PM
This revision was automatically updated to reflect the committed changes.