Directly emit code for the mask checks at the start of complex functions.

Previously, we used an IfStmt to wrap complex functions with the equivalent
of a "cif" to check to see if the mask was all on, all off, or mixed at the
start of executing non-trivial functions.  This had the unintended side
effect of suggesting to other parts of the compiler that the entire function
was under varying control flow (which in turn led to some small code
quality issues.)

Now, we emit the equivalent code directly.
This commit is contained in:
Matt Pharr
2011-12-14 16:19:03 -08:00
parent c0b41ad6f5
commit 10ebe88abf
2 changed files with 57 additions and 20 deletions

View File

@@ -337,7 +337,8 @@ FunctionEmitContext::GetFullMaskPointer() {
void
FunctionEmitContext::SetFunctionMask(llvm::Value *value) {
functionMaskValue = value;
StoreInst(GetFullMask(), fullMaskPointer);
if (bblock != NULL)
StoreInst(GetFullMask(), fullMaskPointer);
}