[PATCH] D34032: [Power9] Exploit vector extract with variable index
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 9 00:03:20 PDT 2017
nemanjai added a comment.
I suspect that the total latency of an `LI, VEXTU[BH][LR]X` for extracting constant elements is probably less than the current set up when a shift in the vector element is required. We should probably use these new instructions for such extractions as well.
When it comes to word extractions, I don't think it makes a difference, but halfword and byte ones are probably better off using the new instructions.
I'm fine with that being a separate patch, but we shouldn't forget it.
================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:1909
+ def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, i64:$Idx)))),
+ (VEXTUHRX (MULLI8 $Idx, 2), $S)>;
+ def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, i64:$Idx)))),
----------------
Please don't use the multiply instruction when a shift is perfectly adequate (and likely much lower latency).
https://reviews.llvm.org/D34032
More information about the llvm-commits
mailing list