GithubHelp home page GithubHelp logo

MemRef type in interface about polygeist HOT 3 OPEN

llvm avatar llvm commented on August 22, 2024
MemRef type in interface

from polygeist.

Comments (3)

wsmoses avatar wsmoses commented on August 22, 2024 1

Yeah for sure. Was thinking about this a little bit and I think the easiest thing to do would be:

  1. When querying the type of an argument where this applies, manually enforce the correct rule by say expanding here: https://github.com/wsmoses/MLIR-GPU/blob/d18dce36513bebef5060adc786115a85593f461d/mlir/tools/mlir-clang/Lib/clang-mlir.cc#L2690
  2. Whenever calling a function do a check for the type to do a memref cast from the default clang convention to our new convention (allowing us to not have to change the definition of how the rest of the AST is lowered)
  3. When starting to emit a function, immediately cast to the clang convention pointer.

In theory this should be sufficient to be correct when combined with everything else and maintain the calling convention in the function declaration. Hopefully it should also allow existing optimizations to propagate versions of the type with the extra information whenever its used.

from polygeist.

wsmoses avatar wsmoses commented on August 22, 2024

Yes indeed we can. The reason for this is that the Clang AST actually represents this as *[300 x double], stripping the last dimension. However, we don't need to adhere to Clang's precise definitions so long as we remain consistent

from polygeist.

kumasento avatar kumasento commented on August 22, 2024

Yes indeed we can. The reason for this is that the Clang AST actually represents this as *[300 x double], stripping the last dimension. However, we don't need to adhere to Clang's precise definitions so long as we remain consistent

Thanks! Would you mind pointing me how I can lift this limitation? I could create a patch for that, maybe add a switchable option.

from polygeist.

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.