Giter Club home page Giter Club logo

Comments (6)

sampsyo avatar sampsyo commented on August 26, 2024

Interesting… maybe I'm just being slow, but I guess I expected that these would be legible as S-expressions instead of this flat symbol list. (Put differently, I'm not exactly sure how to read this RecExpr dump as an expression.)

Is there a chance that this is the output of just formatting a RecExpr directly (i.e., .to_string()), but calling the pretty() method on RecExpr would yield a more legible S-expression?

from diospyros.

JonathanDLTran avatar JonathanDLTran commented on August 26, 2024

I should have started off by printing the S-expressions, and I realized that the mistake arises in how I convert the LLVM IR to Egg expressions, so I have changed the title of the issue to be less misleading.

The new S-expression input is:
(VecMAC (Vec no-temp-name4 (Get no-array-name4 1,) 0 0) (Vec 1 no-temp-name5 (Get no-array-name5 1,) 1) (Vec no-temp-name4 (Get no-array-name3 1,) (Get no-array-name6 3,) 0))
and the new S-expression output is
(VecMAC (Vec (Get no-array-name7 1,) (Get no-array-name9 2,) 0 0) (Vec 1 (Get no-array-name8 2,) (Get no-array-name10 3,) 1) (Vec no-array-name7 no-temp-name6 (Get no-array-name11 2,) 0))

The corrected reason for the problem is that no-array-7 appears by itself as a node in the input S-expression.

from diospyros.

sampsyo avatar sampsyo commented on August 26, 2024

Huh, interesting… this might be dumb, but should I be surprised that the symbol no-array-name7 only appears in the output? It seems weird that egg optimization would "invent" a new array instead of just rearranging accesses to existing arrays…

from diospyros.

JonathanDLTran avatar JonathanDLTran commented on August 26, 2024

This is completely my mistake; I made a copy and paste error, because the correct initial input should be:
(Vec (+ (Get no-array-name7 1,) no-array-name7) (+ (Get no-array-name9 2,) (* (Get no-array-name8 2,) no-temp-name6)) (* (Get no-array-name10 3,) (Get no-array-name11 2,)) 0)

from diospyros.

sampsyo avatar sampsyo commented on August 26, 2024

Got it. I'm still not 100% clear on why the conclusion is that the LLVM->egg translation is wrong... (or did I misunderstand)? Can you point to the subexpression that was generated incorrectly?

from diospyros.

avanhatt avatar avanhatt commented on August 26, 2024

Now resolved.

from diospyros.

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.