This is an archive of the discontinued LLVM Phabricator instance.

Do not legalize large setcc with setcce, introduce setcccarry and do it with usubo/setcccarry.
ClosedPublic

Authored by deadalnix on May 19 2017, 5:52 PM.

Details

Summary

This is a continuation of the work started in D29872 . Passing the carry down as a value rather than as a glue allows for further optimizations. Introducing setcccarry makes the use of addc/subc unecessary and we can start the removal process.

This patch only introduce the optimization strictly required to get the same level of optimization as was available before nothing more.

Diff Detail

Repository
rL LLVM

Event Timeline

deadalnix created this revision.May 19 2017, 5:52 PM
RKSimon edited edge metadata.May 25 2017, 3:00 PM

Can you remove ISD::SETCCE x86 lowering completely as part of this patch?

test/CodeGen/X86/wide-integer-cmp.ll
4 ↗(On Diff #99654)

Why?

I'd rather remove it as part of D33390 than this one. Just in case something goes wrong, it'll be easier to revert.

test/CodeGen/X86/wide-integer-cmp.ll
4 ↗(On Diff #99654)

Just leftovers. I'll remove.

What is your plan for the ARM/Lanai ISD::SETCCE support? That's all that is stopping its removal.

I don't have a specific plan except it needs to be done and I got to figure out how to do it :)

deadalnix updated this revision to Diff 100413.May 26 2017, 8:13 AM

Use getOperationAction as isOperationLegalOrCustom is breaking the AMDGPU backend for some reason. Remove formating change in wide-integer-cmp.ll .

I don't have a specific plan except it needs to be done and I got to figure out how to do it :)

Would it be possible to include the ARM/Lanai changes in this patch?

@RKSimon I don't think it fit the scope of this diff. Plus I'm not that familiar with these backends, so it'll take time and gate other work.

RKSimon added inline comments.Jun 1 2017, 1:39 AM
lib/Target/X86/X86ISelLowering.cpp
34510 ↗(On Diff #100413)

I'm curious why you're dropping ISD::SETCC support here - is the change independent of the rest of the patch?

deadalnix added inline comments.Jun 1 2017, 3:50 AM
lib/Target/X86/X86ISelLowering.cpp
34510 ↗(On Diff #100413)

It never worked and is invalid. It could indeed be part of another diff.

RKSimon accepted this revision.Jun 1 2017, 3:54 AM

LGTM - thanks.

lib/Target/X86/X86ISelLowering.cpp
34510 ↗(On Diff #100413)

OK, please commit this as a separate pre-commit, it doesn't need review.

This revision is now accepted and ready to land.Jun 1 2017, 3:54 AM
deadalnix updated this revision to Diff 101000.Jun 1 2017, 4:14 AM

Remove setcc change in combineX86ADD .

This revision was automatically updated to reflect the committed changes.