11#include " ASPIS.h"
2- #include " Utilis .h"
2+ #include " Utils/Utils .h"
33#include " llvm/IR/IRBuilder.h"
44#include " llvm/Passes/PassBuilder.h"
55#include " llvm/Passes/PassPlugin.h"
@@ -25,7 +25,7 @@ bool unicity(int candidate,
2525 return false ;
2626}
2727
28- void RacfedTry ::initializeBlocksSignatures (
28+ void RACFED ::initializeBlocksSignatures (
2929 Module &Md, std::map<BasicBlock *, int > &RandomNumberBBs,
3030 std::map<BasicBlock *, int > &SubRanPrevVals,
3131 std::map<BasicBlock *, int > &SumIntraInstruction) {
@@ -74,7 +74,7 @@ int countOriginalInstructions(BasicBlock &BB) {
7474 return count;
7575}
7676
77- void RacfedTry ::splitBBsAtCalls (Module &Md) {
77+ void RACFED ::splitBBsAtCalls (Module &Md) {
7878 for (Function &Fn : Md) {
7979 if (shouldCompile (Fn, FuncAnnotations)) {
8080 std::vector<CallBase *> CallInsts;
@@ -95,7 +95,7 @@ void RacfedTry::splitBBsAtCalls(Module &Md) {
9595 }
9696}
9797
98- CallBase *RacfedTry ::isCallBB (BasicBlock &BB) {
98+ CallBase *RACFED ::isCallBB (BasicBlock &BB) {
9999 for (Instruction &I : BB) {
100100 if (isa<CallBase>(&I) && !isa<IntrinsicInst>(&I)) {
101101 return cast<CallBase>(&I);
@@ -104,12 +104,12 @@ CallBase *RacfedTry::isCallBB(BasicBlock &BB) {
104104 return nullptr ;
105105}
106106
107- void RacfedTry ::initializeEntryBlocksMap (Module &Md) {
107+ void RACFED ::initializeEntryBlocksMap (Module &Md) {
108108 // Implementation for INTRA_FUNCTION_CFC == 1, left empty for now as we
109109 // default to 0
110110}
111111
112- Value *RacfedTry ::getCondition (Instruction &I) {
112+ Value *RACFED ::getCondition (Instruction &I) {
113113 // Helper to get condition from terminator if it's a branch
114114 if (BranchInst *BI = dyn_cast<BranchInst>(&I)) {
115115 if (BI->isConditional ()) {
@@ -119,7 +119,7 @@ Value *RacfedTry::getCondition(Instruction &I) {
119119 return nullptr ;
120120}
121121
122- void RacfedTry ::createCFGVerificationBB (
122+ void RACFED ::createCFGVerificationBB (
123123 BasicBlock &BB, std::map<BasicBlock *, int > &RandomNumberBBs,
124124 std::map<BasicBlock *, int > &SubRanPrevVals, Value &RuntimeSig,
125125 Value &RetSig, BasicBlock &ErrBB) {
@@ -251,7 +251,7 @@ void RacfedTry::createCFGVerificationBB(
251251 }
252252}
253253
254- PreservedAnalyses RacfedTry ::run (Module &Md, ModuleAnalysisManager &AM) {
254+ PreservedAnalyses RACFED ::run (Module &Md, ModuleAnalysisManager &AM) {
255255 std::map<BasicBlock*, int > RandomNumberBBs;
256256 std::map<BasicBlock*, int > SubRanPrevVals;
257257 std::map<BasicBlock *, int > SumIntraInstruction;
@@ -288,12 +288,12 @@ PreservedAnalyses RacfedTry::run(Module &Md, ModuleAnalysisManager &AM) {
288288extern " C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
289289
290290llvmGetPassPluginInfo () {
291- return {LLVM_PLUGIN_API_VERSION, " RacfedTry " , " v0.1" , [](PassBuilder &PB) {
291+ return {LLVM_PLUGIN_API_VERSION, " RACFED " , " v0.1" , [](PassBuilder &PB) {
292292 PB.registerPipelineParsingCallback (
293293 [](StringRef Name, ModulePassManager &MPM,
294294 ArrayRef<PassBuilder::PipelineElement>) {
295295 if (Name == " racfed-verify" ) {
296- MPM.addPass (RacfedTry ());
296+ MPM.addPass (RACFED ());
297297 return true ;
298298 }
299299 return false ;
0 commit comments