[PATCH] D18593: [PowerPC] Front end improvements for vec_splat

amehsan via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 11:20:55 PDT 2016


amehsan added a comment.

Nemanja

Thanks for the comparison. This is what I have been thinking about. But if others prefer switch-case implementation, that is fine with me as well. I am not sure this approach is better.

If we have a built-in that accepts variable operands, in CGBuitlin.cpp we can check the operand. If we see a constant value we can emit shufflevector. Otherwise : there are only 4 different masks needed for vec_splat (of vector int or vector unsigned int). We can add a global array that includes all these 4 masks. Then we can load proper mask (using the parameter passed to vec_splat to index the array).  Now once we have the maskwe probably need to generate an intrinsic (Is there an IR instruction that we can use?). So this approach has its own disadvantages too....


Repository:
  rL LLVM

http://reviews.llvm.org/D18593





More information about the llvm-commits mailing list