Remove various equality checks between GetInternalMask() and LLVMMaskAllOn
These were never kicking in, since GetInternalMask() always loads from the mask storage memory.
This commit is contained in:
15
ctx.cpp
15
ctx.cpp
@@ -381,13 +381,8 @@ FunctionEmitContext::GetInternalMask() {
|
|||||||
|
|
||||||
llvm::Value *
|
llvm::Value *
|
||||||
FunctionEmitContext::GetFullMask() {
|
FunctionEmitContext::GetFullMask() {
|
||||||
llvm::Value *internalMask = GetInternalMask();
|
return BinaryOperator(llvm::Instruction::And, GetInternalMask(),
|
||||||
if (internalMask == LLVMMaskAllOn && functionMaskValue == LLVMMaskAllOn &&
|
functionMaskValue, "internal_mask&function_mask");
|
||||||
!g->opt.disableMaskAllOnOptimizations)
|
|
||||||
return LLVMMaskAllOn;
|
|
||||||
else
|
|
||||||
return BinaryOperator(llvm::Instruction::And, GetInternalMask(),
|
|
||||||
functionMaskValue, "internal_mask&function_mask");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -673,9 +668,7 @@ FunctionEmitContext::Break(bool doCoherenceCheck) {
|
|||||||
// If all of the enclosing 'if' tests in the loop have uniform control
|
// If all of the enclosing 'if' tests in the loop have uniform control
|
||||||
// flow or if we can tell that the mask is all on, then we can just
|
// flow or if we can tell that the mask is all on, then we can just
|
||||||
// jump to the break location.
|
// jump to the break location.
|
||||||
if (inSwitchStatement() == false &&
|
if (inSwitchStatement() == false && ifsInCFAllUniform(CFInfo::Loop)) {
|
||||||
(ifsInCFAllUniform(CFInfo::Loop) ||
|
|
||||||
GetInternalMask() == LLVMMaskAllOn)) {
|
|
||||||
BranchInst(breakTarget);
|
BranchInst(breakTarget);
|
||||||
if (ifsInCFAllUniform(CFInfo::Loop) && doCoherenceCheck)
|
if (ifsInCFAllUniform(CFInfo::Loop) && doCoherenceCheck)
|
||||||
Warning(currentPos, "Coherent break statement not necessary in "
|
Warning(currentPos, "Coherent break statement not necessary in "
|
||||||
@@ -730,7 +723,7 @@ FunctionEmitContext::Continue(bool doCoherenceCheck) {
|
|||||||
}
|
}
|
||||||
AssertPos(currentPos, controlFlowInfo.size() > 0);
|
AssertPos(currentPos, controlFlowInfo.size() > 0);
|
||||||
|
|
||||||
if (ifsInCFAllUniform(CFInfo::Loop) || GetInternalMask() == LLVMMaskAllOn) {
|
if (ifsInCFAllUniform(CFInfo::Loop)) {
|
||||||
// Similarly to 'break' statements, we can immediately jump to the
|
// Similarly to 'break' statements, we can immediately jump to the
|
||||||
// continue target if we're only in 'uniform' control flow within
|
// continue target if we're only in 'uniform' control flow within
|
||||||
// loop or if we can tell that the mask is all on.
|
// loop or if we can tell that the mask is all on.
|
||||||
|
|||||||
11
stmt.cpp
11
stmt.cpp
@@ -494,16 +494,7 @@ IfStmt::emitMaskedTrueAndFalse(FunctionEmitContext *ctx, llvm::Value *oldMask,
|
|||||||
void
|
void
|
||||||
IfStmt::emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *ltest) const {
|
IfStmt::emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *ltest) const {
|
||||||
llvm::Value *oldMask = ctx->GetInternalMask();
|
llvm::Value *oldMask = ctx->GetInternalMask();
|
||||||
if (ctx->GetFullMask() == LLVMMaskAllOn &&
|
if (doAllCheck) {
|
||||||
!g->opt.disableCoherentControlFlow &&
|
|
||||||
!g->opt.disableMaskAllOnOptimizations) {
|
|
||||||
// We can tell that the mask is on statically at compile time; just
|
|
||||||
// emit code for the 'if test with the mask all on' path
|
|
||||||
llvm::BasicBlock *bDone = ctx->CreateBasicBlock("cif_done");
|
|
||||||
emitMaskAllOn(ctx, ltest, bDone);
|
|
||||||
ctx->SetCurrentBasicBlock(bDone);
|
|
||||||
}
|
|
||||||
else if (doAllCheck) {
|
|
||||||
// We can't tell if the mask going into the if is all on at the
|
// We can't tell if the mask going into the if is all on at the
|
||||||
// compile time. Emit code to check for this and then either run
|
// compile time. Emit code to check for this and then either run
|
||||||
// the code for the 'all on' or the 'mixed' case depending on the
|
// the code for the 'all on' or the 'mixed' case depending on the
|
||||||
|
|||||||
Reference in New Issue
Block a user