This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add integer promotion support for vp.select
ClosedPublic

Authored by victor-eds on Dec 30 2021, 4:18 AM.

Details

Summary

Promote select, vselect and vp.select in a similar way.

Diff Detail

Event Timeline

victor-eds created this revision.Dec 30 2021, 4:18 AM
victor-eds requested review of this revision.Dec 30 2021, 4:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2021, 4:18 AM
victor-eds edited the summary of this revision. (Show Details)

Call getSelect instead of getNode

Change indentation

Add comments for boolean arguments

Change commit message

victor-eds retitled this revision from [LegalizeTypes][VP] Add integer promotion support for vp_select to [LegalizeTypes][VP] Add integer promotion support for vp.select.
victor-eds edited the summary of this revision. (Show Details)

Change commit message

Apply format changes

LGTM other than nit. I'd prefer to leave official acceptance to someone outside our company, though.

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1133

nit: maybe we should rename this function as it suggests it only handles (upper-case) ISD::SELECT rather than the family of selects. PromoteIntRes_Select? I dunno if that's a great name but SELECT is misleading.

simoll added a comment.Jan 3 2022, 8:02 AM

LGTM

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1133

+1 for PromoteIntRes_Select

craig.topper added inline comments.Jan 3 2022, 10:20 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
242

Could check the opcode inside the function and have all 3 opcodes checked in the same place in the switch?

1133

+1 for PromoteIntRes_Select

craig.topper added inline comments.Jan 3 2022, 10:22 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1140

Use getNode(N->getOpcode() to match the widening patch and avoid a runtime check for of the condition type to pick the opcode.

victor-eds updated this revision to Diff 397227.Jan 4 2022, 1:36 AM

Drop boolean argument

victor-eds marked 5 inline comments as done.Jan 4 2022, 1:37 AM

Done

craig.topper accepted this revision.Jan 4 2022, 9:55 PM

LGTM with that one comment.

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
81

Restore the old formatting with the call and the break on the same line as the case.

This revision is now accepted and ready to land.Jan 4 2022, 9:55 PM
This revision was landed with ongoing or failed builds.Jan 5 2022, 3:02 AM
This revision was automatically updated to reflect the committed changes.