Actually make all 'if' statements check for 'all off' mask.

Contrary to claims in 0c2048385, that checkin didn't include the changes
to not run if/else blocks if none of the program instances wanted to be
running them.  This checkin fixes that and thus actually fixes issue #74.
This commit is contained in:
Matt Pharr
2011-09-13 19:48:04 -07:00
parent e2a88d491f
commit 0848c2cc19
2 changed files with 48 additions and 54 deletions

6
stmt.h
View File

@@ -103,7 +103,7 @@ private:
class IfStmt : public Stmt {
public:
IfStmt(Expr *testExpr, Stmt *trueStmts, Stmt *falseStmts,
bool doCoherentCheck, SourcePos pos);
bool doAllCheck, SourcePos pos);
void EmitCode(FunctionEmitContext *ctx) const;
void Print(int indent) const;
@@ -125,11 +125,11 @@ private:
source and thus, if the emitted code should check to see if all
active program instances want to follow just one of the 'true' or
'false' blocks. */
const bool doCoherentCheck;
const bool doAllCheck;
void emitMaskedTrueAndFalse(FunctionEmitContext *ctx, llvm::Value *oldMask,
llvm::Value *test) const;
void emitCoherentTests(FunctionEmitContext *ctx, llvm::Value *test) const;
void emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *test) const;
void emitMaskAllOn(FunctionEmitContext *ctx,
llvm::Value *test, llvm::BasicBlock *bDone) const;
void emitMaskMixed(FunctionEmitContext *ctx, llvm::Value *oldMask,