Page MenuHomePhabricator

[X86] Move splat addends from the gather/scatter index operand to the base address
Needs ReviewPublic

Authored by pengfei on Mon, Oct 11, 6:32 PM.

Details

Summary

This can avoid a vector add and a constant pool load. Or an explicit broadcast in case of non-constant.

Also reverse the transform any time we encounter a constant index addend that can't be moved to base. In that case pull the constant from base into the index. This reduces code size needed for the displacement since we needed the index add anyway. Limit this to scale of 1 to avoid divisibility and wrap issues.

Authored by Craig.

Diff Detail

Event Timeline

pengfei created this revision.Mon, Oct 11, 6:32 PM
pengfei requested review of this revision.Mon, Oct 11, 6:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Oct 11, 6:32 PM
craig.topper added inline comments.Wed, Oct 13, 9:33 AM
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
2503

Please run clang-format

2525

"gather scatter" -> "gather/scatter" or "gather or scatter"

llvm/lib/Target/X86/X86ISelLowering.cpp
50268

Drop the comma after possible.

"case case" -> "case,"

pengfei updated this revision to Diff 379569.Wed, Oct 13, 5:40 PM
pengfei marked 3 inline comments as done.

Address review comments. Thanks Craig.