added some #ifdef .. #endif for control flow tests
This commit is contained in:
21
stmt.cpp
21
stmt.cpp
@@ -568,6 +568,19 @@ IfStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
if (testValue == NULL)
|
if (testValue == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (!isUniform && g->target->getISA() == Target::NVPTX)
|
||||||
|
{
|
||||||
|
/* With "nvptx" target, SIMT hardware takes care of non-uniform
|
||||||
|
* control flow. We trick ISPC to generate uniform control flow.
|
||||||
|
*/
|
||||||
|
testValue = ctx->ExtractInst(testValue, 0);
|
||||||
|
isUniform = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (isUniform) {
|
if (isUniform) {
|
||||||
ctx->StartUniformIf();
|
ctx->StartUniformIf();
|
||||||
if (doAllCheck)
|
if (doAllCheck)
|
||||||
@@ -849,7 +862,11 @@ IfStmt::emitMaskMixed(FunctionEmitContext *ctx, llvm::Value *oldMask,
|
|||||||
|
|
||||||
// Do any of the program instances want to run the 'true'
|
// Do any of the program instances want to run the 'true'
|
||||||
// block? If not, jump ahead to bNext.
|
// block? If not, jump ahead to bNext.
|
||||||
|
#if 1
|
||||||
llvm::Value *maskAnyTrueQ = ctx->Any(ctx->GetFullMask());
|
llvm::Value *maskAnyTrueQ = ctx->Any(ctx->GetFullMask());
|
||||||
|
#else
|
||||||
|
llvm::Value *maskAnyTrueQ = ctx->ExtractInst(ctx->GetFullMask(),0);
|
||||||
|
#endif
|
||||||
ctx->BranchInst(bRunTrue, bNext, maskAnyTrueQ);
|
ctx->BranchInst(bRunTrue, bNext, maskAnyTrueQ);
|
||||||
|
|
||||||
// Emit statements for true
|
// Emit statements for true
|
||||||
@@ -866,7 +883,11 @@ IfStmt::emitMaskMixed(FunctionEmitContext *ctx, llvm::Value *oldMask,
|
|||||||
|
|
||||||
// Similarly, check to see if any of the instances want to
|
// Similarly, check to see if any of the instances want to
|
||||||
// run the 'false' block...
|
// run the 'false' block...
|
||||||
|
#if 1
|
||||||
llvm::Value *maskAnyFalseQ = ctx->Any(ctx->GetFullMask());
|
llvm::Value *maskAnyFalseQ = ctx->Any(ctx->GetFullMask());
|
||||||
|
#else
|
||||||
|
llvm::Value *maskAnyFalseQ = ctx->ExtractInst(ctx->GetFullMask(),0);
|
||||||
|
#endif
|
||||||
ctx->BranchInst(bRunFalse, bDone, maskAnyFalseQ);
|
ctx->BranchInst(bRunFalse, bDone, maskAnyFalseQ);
|
||||||
|
|
||||||
// Emit code for false
|
// Emit code for false
|
||||||
|
|||||||
Reference in New Issue
Block a user