Broadcast implementation as InsertElement+Shuffle and related improvements

This commit is contained in:
Dmitry Babokin
2013-04-10 02:18:24 +04:00
parent 603abf70dc
commit 5898532605
6 changed files with 153 additions and 56 deletions

View File

@@ -264,8 +264,13 @@ extern bool LLVMExtractVectorInts(llvm::Value *v, int64_t ret[], int *nElts);
constant vector. For anything more complex (e.g. some other arbitrary
value, it doesn't try to extract element values into the returned
array.
This also handles common broadcast pattern:
%broadcast_init.0 = insertelement <4 x i32> undef, i32 %val, i32 0
%broadcast.1 = shufflevector <4 x i32> %smear.0, <4 x i32> undef,
<4 x i32> zeroinitializer
*/
extern void LLVMFlattenInsertChain(llvm::InsertElementInst *ie, int vectorWidth,
extern void LLVMFlattenInsertChain(llvm::Value *inst, int vectorWidth,
llvm::Value **elements);
/** This is a utility routine for debugging that dumps out the given LLVM