This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Option --combiner-select-seq
Needs RevisionPublic

Authored by appcs on Oct 16 2022, 1:17 PM.

Details

Summary
[DAGCombiner] Option --combiner-select-seq
    
Minimize condition-code lifetime for select sequences over constants in arithmetic progressions.

Diff Detail

Event Timeline

appcs created this revision.Oct 16 2022, 1:17 PM
appcs requested review of this revision.Oct 16 2022, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 16 2022, 1:17 PM
appcs added a comment.Oct 16 2022, 1:24 PM

Thanks to the Works On Arm program https://www.arm.com/solutions/infrastructure/works-on-arm for providing an equinix-metal-arm64-cluster by Equinix https://www.equinix.com for developing this solution.

appcs edited the summary of this revision. (Show Details)Oct 16 2022, 1:25 PM
appcs added a comment.Oct 16 2022, 2:41 PM

For the test case from https://bugs.llvm.org/show_bug.cgi?id=51147 the (cross-compiling on RHEL8/x86_64) build times:
without -mllvm --combiner-select-seq: real 24m16.804s
with -mllvm --combiner-select-seq: real 0m0.897s
with about 25% code size reduction under the option.

appcs added a reviewer: fhahn.Oct 16 2022, 2:51 PM
appcs added a reviewer: kristof.beyls.
appcs updated this revision to Diff 473357.Nov 4 2022, 4:02 PM

Added a cost-benefit option: --combiner-select-seq-min-cost-benefit
Added a check: <ConstantSDNode>.getAPIntValue().getMinSignedBits() <= 64

appcs added a subscriber: anmol.

Why is this being proposed for SelectionDAG and not CodeGenPrepare or similar?

RKSimon requested changes to this revision.Dec 5 2022, 5:02 AM
This revision now requires changes to proceed.Dec 5 2022, 5:02 AM