[PATCH] D33690: [PowerPC] Match vec_revb builtins to P9 instructions.

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 04:53:26 PDT 2017


inouehrs added a comment.

I agree to Nemanja's comment. Since we have so many special patterns of permutation (e.g. byte reverse, rotate, shift, merge, splat, pack, unpack etc etc), we need a robust framework to optimize these patterns. Maybe we can create a table that maps a shuffle pattern to a specific instruction.

In complex case that can map onto a couple of instructions, there is a trade-off between consuming permutation pipeline resource and a vector register; e.g. "reverse-bytes-within-each-word-and-rotate-left-by-word" can be executed by one permute instruction using one additional vector register for the shuffle pattern. In hot loops, one permute approach may be a better choice than 2 instruction approach since we may be able to prepare shuffle pattern out side loop (if we have enough vector registers).


https://reviews.llvm.org/D33690





More information about the llvm-commits mailing list