This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] `LowerZERO_EXTEND_VECTOR_INREG()`: recursively apply `zip1` until done
AbandonedPublic

Authored by lebedev.ri on Dec 26 2022, 5:06 PM.

Details

Summary

While the one-step zip1 lowering seemed obviously good,
here i feel like i should double-check: is 2 or more zip1
not worse than a tbl?
I'm guessing so, because it avoids constant pool load.

This comes up in a follow-up change to combineShuffleToZeroExtendVectorInReg().

Diff Detail

Unit TestsFailed

Event Timeline

lebedev.ri created this revision.Dec 26 2022, 5:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2022, 5:06 PM
fhahn added inline comments.Dec 30 2022, 10:29 AM
llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

I think that for this lowering is slightly worse in general for CPUs that have efficient implementations of tbl, as tbl results in shorter dependency chains than having 2 zip1, with one depending on the other. The tbl lowering is only used in loops, when the load from the constant pool is hoisted outside the loop.

@fhahn IOW, this change is not an improvement,
and reverse changes are not regressions?

llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

Note: i personally do not care what happens here, i'm only asking because this comes up
as a "regression" in further patches (D140677 e.g.), so i'm wondering if this needs to be dealt with.

fhahn added inline comments.Dec 30 2022, 10:59 AM
llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

Yeah, IMO this is a regression that should be avoided (at least in loops)

lebedev.ri abandoned this revision.Dec 30 2022, 11:00 AM
lebedev.ri marked 2 inline comments as done.

@fhahn thank you for taking a look!

llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

Err, i'm still confused. You are saying this patch is not needed, correct? :)

fhahn added inline comments.Jan 2 2023, 10:41 AM
llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

Yep, it should not be needed.

lebedev.ri marked 2 inline comments as done.Jan 2 2023, 10:44 AM
lebedev.ri added inline comments.
llvm/test/CodeGen/AArch64/zext-to-tbl.ll
1025

Cheers, thank you.