Additional cleanup to enable more broadcasts

This commit is contained in:
Dmitry Babokin
2013-04-10 15:34:21 +04:00
parent 0704081d91
commit 4c35d9456a
4 changed files with 67 additions and 50 deletions

9
ctx.h
View File

@@ -297,7 +297,7 @@ public:
/** Generate ConstantVector, which contains ProgramIndex, i.e.
< i32 0, i32 1, i32 2, i32 3> */
llvm::Value *ProgramIndex();
llvm::Value *ProgramIndexVector(bool is32bits = true);
/** Given a string, create an anonymous global variable to hold its
value and return the pointer to the string. */
@@ -504,9 +504,16 @@ public:
llvm::Value *InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt,
const char *name = NULL);
/** This convenience method maps to an llvm::ShuffleVectorInst. */
llvm::Value *ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask,
const char *name = NULL);
/** This convenience method to generate broadcast pattern. It takes a value
and a vector type. Type of the value must match element type of the
vector. */
llvm::Value *BroadcastValue(llvm::Value *v, llvm::Type *vecType,
const char *name = NULL);
llvm::PHINode *PhiNode(llvm::Type *type, int count,
const char *name = NULL);
llvm::Instruction *SelectInst(llvm::Value *test, llvm::Value *val0,