GithubHelp home page GithubHelp logo

Comments (1)

ChrisCummins avatar ChrisCummins commented on June 2, 2024
  • Where the loop optimization information be included in LLVM IR, is it only in Metadata? I guess Yes after referring to LLVM-loop-unrolling.

That looks right to me.

  • Does ProGraML use the Metadata information in LLVM IR to construct control flow, data flow, and call flow (as structural information)?

It doesn't automatically add metadata info to instructions. You would need to extend ProgramGraphBuilder::AddLlvmInstruction() to pull out any extra metadata you want and embed it in the graph as node features. Here is an example of how we do this for instruction profiling data:

https://github.com/ChrisCummins/ProGraML/blob/development/programl/ir/llvm/internal/program_graph_builder.cc#L307-L319

I'd happily accept a patch that also records loop unroll information, as I think that would be useful.

#if PROGRAML_LLVM_VERSION_MAJOR > 3
// Add profiling information features, if available.
uint64_t profTotalWeight;
if (instruction->extractProfTotalWeight(profTotalWeight)) {
graph::AddScalarFeature(node, "llvm_profile_total_weight", profTotalWeight);
}
uint64_t profTrueWeight;
uint64_t profFalseWeight;
if (instruction->extractProfMetadata(profTrueWeight, profFalseWeight)) {
graph::AddScalarFeature(node, "llvm_profile_true_weight", profTrueWeight);
graph::AddScalarFeature(node, "llvm_profile_false_weight", profFalseWeight);
}
#endif

Cheers,
Chris

from programl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.