some performance fix. it works, but have no idea why. checkpoint

This commit is contained in:
Evghenii
2014-02-05 15:36:06 +01:00
parent 686c1d676d
commit aeb2f01a15

10
ctx.cpp
View File

@@ -1451,6 +1451,15 @@ FunctionEmitContext::Extract(llvm::Value *vector, llvm::Value *lane)
llvm::Value *
FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2) {
if (g->target->getISA() == Target::NVPTX)
{
// Compare the two masks to get a vector of i1s
llvm::Value *cmp = CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ,
v1, v2, "v1==v2");
return ExtractInst(cmp, 0); /* this works without calling All(..) in PTX. Why ?!? */
}
else
{
#if 0
// Compare the two masks to get a vector of i1s
llvm::Value *cmp = CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ,
@@ -1466,6 +1475,7 @@ FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2) {
LLVMGetName("equal", v1, v2));
#endif
}
}
llvm::Value *
FunctionEmitContext::ProgramIndexVector(bool is32bits) {