vectorized coverage only possible for llvm 14 :(
MODIFY
instrumentation/SanitizerCoverageLTO.so.cc
instrumentation/SanitizerCoverageLTO.so.cc
@@ -1313,7 +1313,10 @@ void ModuleSanitizerCoverage::instrumentFunction(
result = IRB.CreateSelect(condition, val1, val2);
inst += 2;
- } else if (t->getTypeID() == llvm::Type::FixedVectorTyID) {
+ }
+
+#if LLVM_VERSION_MAJOR > 13
+ else if (t->getTypeID() == llvm::Type::FixedVectorTyID) {
FixedVectorType *tt = dyn_cast<FixedVectorType>(t);
if (tt) {
@@ -1355,7 +1358,10 @@ void ModuleSanitizerCoverage::instrumentFunction(
}
- } else {
+ } else
+
+#endif
+ {
unhandled++;
continue;

MODIFY
instrumentation/SanitizerCoveragePCGUARD.so.cc
instrumentation/SanitizerCoveragePCGUARD.so.cc
@@ -895,6 +895,12 @@ bool ModuleSanitizerCoverage::InjectCoverage(Function & F,
CallInst *callInst = nullptr;
+ /*
+ std::string errMsg;
+ raw_string_ostream os(errMsg);
+ IN.print(os);
+ fprintf(stderr, "X: %s\n", os.str().c_str());
+ */
if ((callInst = dyn_cast<CallInst>(&IN))) {
Function *Callee = callInst->getCalledFunction();
@@ -948,7 +954,10 @@ bool ModuleSanitizerCoverage::InjectCoverage(Function & F,
result = IRB.CreateSelect(condition, GuardPtr1, GuardPtr2);
- } else if (t->getTypeID() == llvm::Type::FixedVectorTyID) {
+ } else
+
+#if LLVM_VERSION_MAJOR > 13
+ if (t->getTypeID() == llvm::Type::FixedVectorTyID) {
FixedVectorType *tt = dyn_cast<FixedVectorType>(t);
if (tt) {
@@ -1015,9 +1024,13 @@ bool ModuleSanitizerCoverage::InjectCoverage(Function & F,
}
- } else {
+ } else
+
+#endif
+ {
unhandled++;
+ continue;
}

MODIFY
instrumentation/cmplog-instructions-pass.cc
instrumentation/cmplog-instructions-pass.cc
@@ -377,7 +377,6 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
vector_cnt = tt->getElementCount().getFixedValue();
ty1 = ty0 = tt->getElementType();
- fprintf(stderr, "vec %u\n", vector_cnt);
}

vectorized coverage only possible for llvm 14 :(