This is an archive of the discontinued LLVM Phabricator instance.

Add ADDC to SelectionDAG::computeKnownBits and ComputeNumSignBits.
ClosedPublic

Authored by deadalnix on Feb 3 2017, 4:35 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

deadalnix created this revision.Feb 3 2017, 4:35 PM
RKSimon edited edge metadata.Feb 4 2017, 4:14 AM

Tests?

I asked myself the same question. Not sure how I'd test this.

davide added a subscriber: davide.Feb 5 2017, 10:47 AM

I asked myself the same question. Not sure how I'd test this.

Probably you can mimic the tests for add (if any?)

Probably you can mimic the tests for add (if any?)

I'm not aware of any, however, surely, there is some test somewhere that depends on it. I'll try removing the add case and see what breaks.

Probably you can mimic the tests for add (if any?)

I'm not aware of any, however, surely, there is some test somewhere that depends on it. I'll try removing the add case and see what breaks.

There are very few scalar tests - llvm\test\CodeGen\X86\known-bits.ll is almost empty. The llvm\test\CodeGen\X86\known-bits-vector.ll has more examples - scalarizing one of those should be trivial.

deadalnix updated this revision to Diff 87173.Feb 5 2017, 4:32 PM

Add test case for add and adc.

The test case for adc is a bit complex, but it was necessary to put the adc in a context where its surrounding cannot be optimized away. That means computing a result using the carry, and returning it somehow, while making sure the result of the adc itself can be optimized away.

Please can you rebase? I've added the current known-bits.ll test codegen (rL294184) so you can show the delta.

RKSimon accepted this revision.Feb 6 2017, 7:00 AM

LGTM

This revision is now accepted and ready to land.Feb 6 2017, 7:00 AM
This revision was automatically updated to reflect the committed changes.