mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-20 02:47:11 +03:00
Rose: Move all literal operations into program
Replace the RoseLiteral structure with more program instructions; now, instead of each literal ID leading to a RoseLiteral, it simply has a program to run (and a delay rebuild program). This commit also makes some other improvements: * CHECK_STATE instruction, for use instead of a sparse iterator over a single element. * Elide some checks (CHECK_LIT_EARLY, ANCHORED_DELAY, etc) when not needed. * Flatten PUSH_DELAYED behaviour to one instruction per delayed literal, rather than the mask/index-list approach used before. * Simple program cache at compile time for deduplication.
This commit is contained in:
committed by
Matthew Barr
parent
255d84a83a
commit
10cda4cc33
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2016, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -36,21 +36,6 @@
|
||||
|
||||
namespace ue2 {
|
||||
|
||||
// Calculate the minimum depth for the given set of vertices, ignoring those
|
||||
// with depth 1.
|
||||
template<class Cont>
|
||||
static
|
||||
u8 calcMinDepth(const std::map<RoseVertex, u32> &depths, const Cont &verts) {
|
||||
u8 d = 255;
|
||||
for (RoseVertex v : verts) {
|
||||
u8 vdepth = (u8)std::min((u32)255, depths.at(v));
|
||||
if (vdepth > 1) {
|
||||
d = std::min(d, vdepth);
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
// Comparator for vertices using their index property.
|
||||
struct VertexIndexComp {
|
||||
VertexIndexComp(const RoseGraph &gg) : g(gg) {}
|
||||
|
||||
Reference in New Issue
Block a user