diff --git a/include/llvm/PML.h b/include/llvm/PML.h index 3bbd779790b6c2238cf97e69d06d0eb63961941e..d5e9b914f800dea23c849ab232e214dc72f3fe3b 100644 --- a/include/llvm/PML.h +++ b/include/llvm/PML.h @@ -934,12 +934,13 @@ struct MappingTraits< FlowFact* > { YAML_IS_PTR_SEQUENCE_VECTOR(FlowFact) /// Representation Level (source, bitcode, machinecode) -enum PlatinaType { unknown, guard, callee }; +enum PlatinaType { unknown, guard, callee, lbound }; template <> struct ScalarEnumerationTraits<PlatinaType> { static void enumeration(IO &io, PlatinaType& level) { io.enumCase(level, "guard", guard); io.enumCase(level, "callee", callee); + io.enumCase(level, "lbound", lbound); io.enumCase(level, "unknown", unknown); } }; diff --git a/lib/CodeGen/PMLExport.cpp b/lib/CodeGen/PMLExport.cpp index 4ab38a773f23bc44d1bae1339199ab3f7eaf60d4..84cee67f758fabb500fd831e28d46880ff393e25 100644 --- a/lib/CodeGen/PMLExport.cpp +++ b/lib/CodeGen/PMLExport.cpp @@ -421,6 +421,18 @@ void PMLBitcodeExport::exportInstruction(yaml::Instruction* I, MDString *expr = cast<MDString>(nexpr->getOperand(0)); if (type->getString() == "guard") { YDoc.addPlatinaFact(createPlatinaFact(yaml::guard, &*BB, expr->getString())); + } else if(type->getString() == "lbound") { + Loop *Loop = LI.getLoopFor(&*BB); + + if (Loop) { + const BasicBlock *Header = Loop->getHeader(); + YDoc.addPlatinaFact(createPlatinaFact(yaml::lbound, + Header, + expr->getString())); + } else { + errs() << "Skipping: Cannot find loop for platina annotated loop bound:\n" + << *CI << "\n"; + } } } break;