Skip to content

Commit a0469cf

Browse files
Release/2.2.0
- Stability improvements - Fixes to pattern detection and variable classification - Performance improvements - Improved GUI - Added library functions (basic code generator, utilities to handle file mappings) - Added profiling of memory allocations for improved dependency accuracy
2 parents 734124b + c89cb03 commit a0469cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3210
-970
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Setup Python
5353
uses: actions/setup-python@v2
5454
with:
55-
python-version: 3.6
55+
python-version: 3.8
5656

5757
- name: Install Python dependencies
5858
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ coverage.xml
6868
.hypothesis/
6969
.pytest_cache/
7070

71+
# Profiling reports
72+
profiling_stats.txt
73+
7174
# Translations
7275
*.mo
7376
*.pot

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ if(${DP_INSTALLATION_EXIT_CODE})
7878
endif()
7979

8080
# save build configuration to build/build_config.txt
81+
file(REMOVE "${DiscoPoP_BINARY_DIR}/build_config.txt")
8182
file(TOUCH "${DiscoPoP_BINARY_DIR}/build_config.txt")
8283
file(APPEND "${DiscoPoP_BINARY_DIR}/build_config.txt" "DP_BUILD=${DiscoPoP_BINARY_DIR}\n")
8384
file(APPEND "${DiscoPoP_BINARY_DIR}/build_config.txt" "DP_SOURCE=${DiscoPoP_SOURCE_DIR}\n")

DiscoPoP/DiscoPoP.cpp

Lines changed: 412 additions & 49 deletions
Large diffs are not rendered by default.

DiscoPoP/DiscoPoP.hpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ namespace {
8989
string type;
9090
string defLine;
9191
string isArray;
92+
bool readAccess;
93+
bool writeAccess;
9294

9395
Variable_struct(const Variable_struct &other)
94-
: name(other.name), type(other.type), defLine(other.defLine) {}
96+
: name(other.name), type(other.type), defLine(other.defLine),
97+
readAccess(other.readAccess), writeAccess(other.writeAccess) {}
9598

96-
Variable_struct(string n, string t, string d)
97-
: name(n), type(t), defLine(d) {}
99+
Variable_struct(string n, string t, string d, bool readAccess, bool writeAccess)
100+
: name(n), type(t), defLine(d), readAccess(readAccess), writeAccess(writeAccess){}
98101

99102
// We have a set of this struct. The set doesn't know how to order the
100103
// elements.
@@ -157,6 +160,8 @@ namespace {
157160
set <Variable> localVariableNames;
158161
set <Variable> globalVariableNames;
159162

163+
bool performsFileIO;
164+
160165
// Map to record function call line numbers
161166
map<int, vector<Node *>> callLineTofunctionMap;
162167

@@ -166,6 +171,7 @@ namespace {
166171
writeDataSize = 0;
167172
instructionsCount = 0;
168173
// BB = NULL;
174+
performsFileIO = false;
169175
}
170176

171177
void removeCU() {
@@ -256,6 +262,12 @@ namespace {
256262
// Callback Inserters
257263
//void insertDpInit(const vector<Value*> &args, Instruction *before);
258264
//void insertDpFinalize(Instruction *before);
265+
void instrumentAlloca(AllocaInst *toInstrument);
266+
267+
void instrumentNewOrMalloc(CallInst *toInstrument);
268+
269+
void instrumentDeleteOrFree(CallInst *toInstrument);
270+
259271
void instrumentStore(StoreInst *toInstrument);
260272

261273
void instrumentLoad(LoadInst *toInstrument);
@@ -273,6 +285,7 @@ namespace {
273285
// Callbacks to run-time library
274286
FunctionCallee DpInit, DpFinalize;
275287
FunctionCallee DpRead, DpWrite;
288+
FunctionCallee DpAlloca, DpNew, DpDelete; //, DpDecl;
276289
FunctionCallee DpCallOrInvoke;
277290
FunctionCallee DpFuncEntry, DpFuncExit;
278291
FunctionCallee DpLoopEntry, DpLoopExit;
@@ -405,14 +418,15 @@ namespace {
405418
}
406419
unsigned dp_reduction_get_file_id(llvm::Function *func);
407420
bool dp_reduction_init_util(std::string fmap_path);
408-
char dp_reduction_get_char_for_opcode(unsigned opcode);
421+
char dp_reduction_get_char_for_opcode(llvm::Instruction *instr);
409422
bool dp_reduction_is_operand(llvm::Instruction *instr, llvm::Value *operand);
410423
int dp_reduction_get_op_order(char c);
411424
Type *dp_reduction_pointsToStruct(PointerType *PTy);
412425
string findStructMemberName_static(MDNode *structNode, unsigned idx, IRBuilder<> &builder);
413426
bool dp_reduction_sanityCheck(BasicBlock *BB, int file_id);
414-
int32_t dp_reduction_getLID(Instruction *BI, int32_t &fileID);
427+
LID dp_reduction_getLID(Instruction *BI, int32_t &fileID);
415428
void dp_reduction_insert_functions();
429+
bool check_value_usage(llvm::Value *parentValue, llvm::Value *searchedValue);
416430
llvm::LLVMContext *ctx_;
417431
llvm::Module *module_;
418432
std::ofstream *reduction_file;

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.1
1+
2.2.0

0 commit comments

Comments
 (0)