[PATCH] [X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles

Sanjay Patel spatel at rotateright.com
Fri Mar 20 12:50:07 PDT 2015

Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:203
@@ +202,3 @@
+/// then ignore that half of the mask and clear that half of the vector.
+Instruction *InstCombiner::SimplifyX86vperm2(IntrinsicInst &II) {
+  VectorType *VecTy = cast<VectorType>(II.getType());
spatel wrote:
> andreadb wrote:
> > Why not have a static function instead? If you use a function, you can avoid to to change 'InstCombineInternal.h'.
> No reason other than cut and paste from the code around this. If this is static, we'd have to pass in a reference to the InstCombiner in order to use ReplaceInstUsesWith(), right? Do you think that's cleaner?
I think the use of 'Builder' would also require the InstCombiner reference.



More information about the llvm-commits mailing list