This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Perform last active true vector combine
ClosedPublic

Authored by Allen on Mar 7 2022, 7:16 PM.

Details

Summary

Test bit of lane EC-1 can use P register directly, eg:
Materialize : Idx = (add (mul vscale, NumEls), -1)

           i1 = extract_vector_elt t37, Constant:i64<Idx>
... into: "ptrue p, all" + PTEST

Diff Detail

Event Timeline

Allen created this revision.Mar 7 2022, 7:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 7:16 PM
Allen requested review of this revision.Mar 7 2022, 7:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 7:16 PM
paulwalker-arm added inline comments.Mar 14 2022, 6:38 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
14425

Should this have the same SetCC.getOpcode() == ISD::SETCC restriction as performFirstTrueTestVectorCombine for the same reasons? If not then can you rename the variable.

Allen updated this revision to Diff 415088.Mar 14 2022, 7:26 AM

add restrict SetCC.getOpcode() == ISD::SETCC

paulwalker-arm accepted this revision.Mar 14 2022, 8:45 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
14441

Given it's an equality test it probably doesn't matter but ISD::VSCALE's multiplier is signed whereas getConstantOperandVal returns uint64_t.

This revision is now accepted and ready to land.Mar 14 2022, 8:45 AM
This revision was landed with ongoing or failed builds.Mar 14 2022, 10:28 AM
This revision was automatically updated to reflect the committed changes.
Allen marked an inline comment as done.