Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 0 additions & 177 deletions artifact/bash/generate_tests.sh

This file was deleted.

Empty file.
33 changes: 17 additions & 16 deletions artifact/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ RUN apt install -y sudo \
RUN python3 -m venv /src/venv-py
ENV PATH="/src/venv-py/bin:$PATH"

# Clone and Build LLVM 17
# Clone and Build LLVM 17 with the Daedalus and func-merging patches
RUN git clone --depth 100 -b merge-functions-pass https://github.com/Casperento/llvm-project.git
WORKDIR llvm-project
RUN mkdir -p build
RUN cmake -G Ninja \
-DLLVM_ENABLE_PROJECTS='clang;compiler-rt;lld' \
-DLLVM_ENABLE_PROJECTS='clang;lld' \
-DCMAKE_BUILD_TYPE="Release" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_ENABLE_ASSERTIONS=On \
-S llvm -B build
RUN cmake --build build -- -j 10
RUN cmake --build build -- -j 20
ENV PATH="/src/llvm-project/build/bin:$PATH"

# Clone and Build Daedalus
Expand All @@ -49,24 +49,25 @@ WORKDIR /src
RUN git clone https://github.com/Casperento/daedalus-dbg-toolkit.git
RUN python3 -m pip install -r /src/daedalus-dbg-toolkit/requirements.txt

# Build llvm with func-merging pass
RUN git clone --depth 100 -b code-size https://github.com/rcorcs/llvm-project.git code-size
WORKDIR code-size
RUN mkdir -p build
RUN cmake -G Ninja \
-DLLVM_ENABLE_PROJECTS='clang;compiler-rt;lld' \
-DCMAKE_BUILD_TYPE="Release" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_ENABLE_ASSERTIONS=On \
-S llvm -B build
RUN cmake --build build -- -j 10
# Run experiment 1
WORKDIR /src/daedalus-dbg-toolkit
RUN ./run-experiment.sh -w 10 \
RUN ./run-experiment.sh -w 20 \
-t 120 \
--llvm-project /src/llvm-project \
--llvm-test-suite /src/llvm-test-suite \
--daedalus /src/Daedalus \
--daedalus-branch main \
--lit-results /lit-results \
--errors-dbg /src/daedalus-dbg-toolkit \
--venv /src/venv-py

# Run experiment 2
RUN ./run-experiment-2.sh -w 20 \
-t 120 \
--llvm-project /src/llvm-project \
--code-size /src/code-size \
--llvm-test-suite /src/llvm-test-suite \
--daedalus /src/Daedalus \
--daedalus-branch main \
--lit-results /lit-results \
--errors-dbg /src/daedalus-dbg-toolkit \
--venv /src/venv-py
9 changes: 2 additions & 7 deletions include/ProgramSlice.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <map>
#include <set>

#include "PHIGateAnalyzer.h"
#include "llvm/Analysis/AliasAnalysis.h"

#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Dominators.h"
Expand All @@ -20,13 +20,11 @@
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Error.h"

// #include "llvm/Transforms/IPO/FunctionMerging.h"
#include "PHIGateAnalyzer.h"

namespace llvm {

class ProgramSlice {
public:
ProgramSlice() = default;
/// Constructs a ProgramSlice object.
ProgramSlice(Instruction &I, Function &F, FunctionAnalysisManager &FAM,
std::unordered_map<const BasicBlock *,
Expand All @@ -53,9 +51,6 @@ class ProgramSlice {
/// method as the SimplifyCFGPass
static void simplifyCfg(Function *F, FunctionAnalysisManager &AM);

/// A function to merge two other functions using func-merging pass.
// static FunctionMergeResult mergeFunctions(Function *F1, Function *F2);

/// Retrieves the current slice's parent function.
Function *getParentFunction() const;

Expand Down
20 changes: 0 additions & 20 deletions lib/ProgramSlice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,26 +1126,6 @@ void ProgramSlice::simplifyCfg(Function *F, FunctionAnalysisManager &AM) {
}
}

/**
* @brief A function to merge two other functions using func-merging pass
*
* @details This function runs the MergeFunctions function from the
* func-merging
*
* @param F1 First pointer to the first Function to be merged.
* @param F2 Second pointer to the first Function to be merged.
* @return Function Merging Result object
*/
// FunctionMergeResult ProgramSlice::mergeFunctions(Function *F1, Function
// *F2)
// {
// if (F1->getParent() != F2->getParent())
// return FunctionMergeResult(F1, F2, nullptr);
// FunctionMerger Merger(F1->getParent());
// FunctionMergingOptions Options = FunctionMergingOptions();
// return Merger.merge(F1, F2, "", Options);
// }

/**
* @brief Adds a return instruction to the function F based on the initial
* instruction.
Expand Down
Loading
Loading