Predicated 'if' statement performance improvements.

Go back to running both sides of 'if' statements with masking and without
branching if we can determine that the code is relatively simple (as per
the simple cost model), and is safe to run even if the mask is 'all off'.
This gives a bit of a performance improvement for some of the examples
(most notably, the ray tracer), and is the code that one wants generated
in this case anyhow.
This commit is contained in:
Matt Pharr
2011-09-19 09:54:09 -07:00
parent 9052d4b10b
commit 9921b8e530
6 changed files with 228 additions and 33 deletions

11
expr.h
View File

@@ -123,7 +123,6 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
const Op op;
Expr *expr;
};
@@ -167,7 +166,6 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
const Op op;
Expr *arg0, *arg1;
};
@@ -200,7 +198,6 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
const Op op;
Expr *lvalue, *rvalue;
};
@@ -222,7 +219,6 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
Expr *test, *expr1, *expr2;
};
@@ -264,11 +260,11 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
Expr *func;
ExprList *args;
bool isLaunch;
private:
void resolveFunctionOverloads();
bool tryResolve(bool (*matchFunc)(Expr *, const Type *));
};
@@ -293,7 +289,6 @@ public:
Expr *TypeCheck();
int EstimateCost() const;
private:
Expr *arrayOrVector, *index;
};
@@ -321,7 +316,6 @@ public:
virtual int getElementNumber() const;
protected:
std::string getCandidateNearMatches() const;
Expr *expr;
@@ -507,7 +501,6 @@ public:
Expr *Optimize();
int EstimateCost() const;
private:
const Type *type;
Expr *expr;
};
@@ -527,7 +520,6 @@ public:
Expr *Optimize();
int EstimateCost() const;
private:
Expr *expr;
};
@@ -547,7 +539,6 @@ public:
Expr *Optimize();
int EstimateCost() const;
private:
Expr *expr;
};