Page MenuHomePhabricator

[X86][AVX] Attempt to fold a scaled index into a gather/scatter scale immediate (PR13310)
Changes PlannedPublic

Authored by RKSimon on Aug 23 2021, 4:02 AM.

Details

Summary

If the index operand for a gather/scatter intrinsic is being scaled (self-addition or a shl-by-immediate) then we may be able to fold that scaling into the intrinsic scale immediate value instead.

I did see if we could perform this with X86DAGToDAGISel::matchAddressRecursively, but adding vector support will be a pretty large task for only a minimal benefit.

Fixes PR13310.

Diff Detail

Event Timeline

RKSimon created this revision.Aug 23 2021, 4:02 AM
RKSimon requested review of this revision.Aug 23 2021, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2021, 4:02 AM
RKSimon updated this revision to Diff 369896.Sep 1 2021, 3:49 AM

Fix clang-format warnings

pengfei added inline comments.Sep 1 2021, 6:30 AM
llvm/test/CodeGen/X86/masked_gather_scatter.ll
774

Why do we need an extra xor now?

RKSimon planned changes to this revision.Sep 10 2021, 9:13 AM

I'm going to see whether this would be better moving to matchVectorAddressRecursively now that D111595 has landed.

llvm/test/CodeGen/X86/masked_gather_scatter.ll
774

D112505 - for dependency breaking I guess :)

pengfei added inline comments.Tue, Oct 26, 1:44 AM
llvm/test/CodeGen/X86/masked_gather_scatter.ll
774

Interesting :)

craig.topper added inline comments.Tue, Oct 26, 8:12 AM
llvm/test/CodeGen/X86/masked_gather_scatter.ll
774

I guess this is because we were calling getAVX2Gather which adds dependency breaking?