This is an archive of the discontinued LLVM Phabricator instance.

[X86] Improve codegen for inverted overflow checking intrinsics
ClosedPublic

Authored by aemerson on Sep 21 2017, 5:19 PM.

Details

Summary

[X86] Improve codegen for inverted overflow checking intrinsics.

Adds a new combine for: xor(setcc cc, val), 1 --> setcc (invert(cc), val)

This is the same optimization as the one for AArch64 in D38160 but implemented in a different way.

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Sep 21 2017, 5:19 PM
RKSimon edited edge metadata.Sep 26 2017, 8:27 AM

Please commit overflow-intrinsic-setcc-fold.ll (with fixes suggested) with the current codegen so this patch show the delta

test/CodeGen/X86/overflow-intrinsic-setcc-fold.ll
1

Remove -mcpu=generic and regenerate the file with utils\update_llc_test_checks.py

You mean actually commit the current codegen's test output (with no code changes) and then resubmit this patch as a diff?

You mean actually commit the current codegen's test output (with no code changes) and then resubmit this patch as a diff?

Yes please.

aemerson updated this revision to Diff 116983.Sep 28 2017, 7:08 AM

Committed test in r314416. Updated to show diff in behaviour.

RKSimon accepted this revision.Sep 28 2017, 2:03 PM

Makes sense to me, although it's a pity we can't move more of this into DAGCombine and stop it being so target specific

This revision is now accepted and ready to land.Sep 28 2017, 2:03 PM
This revision was automatically updated to reflect the committed changes.