Improvements to constant folding.
We can now do constant folding with all basic datatypes (the previous implementation handled int32 well, but had limited, if any, coverage for other datatypes.) Reduced a bit of repeated code in the constant folding implementation through template helper functions.
This commit is contained in:
2
ast.cpp
2
ast.cpp
@@ -446,7 +446,7 @@ lCheckAllOffSafety(ASTNode *node, void *data) {
|
||||
}
|
||||
|
||||
int32_t indices[ISPC_MAX_NVEC];
|
||||
int count = ce->AsInt32(indices);
|
||||
int count = ce->GetValues(indices);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
if (indices[i] < 0 || indices[i] >= nElements) {
|
||||
// Index is out of bounds -> not safe
|
||||
|
||||
Reference in New Issue
Block a user