diff --git a/stmt.cpp b/stmt.cpp index 65e895ff..cb547a55 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -428,9 +428,8 @@ DeclStmt::EstimateCost() const { IfStmt::IfStmt(Expr *t, Stmt *ts, Stmt *fs, bool checkCoherence, SourcePos p) : Stmt(p), test(t), trueStmts(ts), falseStmts(fs), doAllCheck(checkCoherence && - !g->opt.disableCoherentControlFlow), - doAnyCheck(test->GetType() != NULL && - test->GetType()->IsVaryingType()) { + !g->opt.disableCoherentControlFlow) { + // have to wait until after type checking to initialize doAnyCheck. } @@ -849,7 +848,6 @@ IfStmt::emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *ltest) const { ctx->EndIf(); } else { - assert(doAnyCheck); llvm::BasicBlock *bDone = ctx->CreateBasicBlock("if_done"); emitMaskMixed(ctx, oldMask, ltest, bDone); ctx->SetCurrentBasicBlock(bDone); diff --git a/stmt.h b/stmt.h index 21d94420..bacb8efb 100644 --- a/stmt.h +++ b/stmt.h @@ -136,7 +136,6 @@ private: active program instances want to follow just one of the 'true' or 'false' blocks. */ const bool doAllCheck; - const bool doAnyCheck; void emitMaskedTrueAndFalse(FunctionEmitContext *ctx, llvm::Value *oldMask, llvm::Value *test) const;