-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mistake in generation of Egg expressions #113
Comments
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 Is there a chance that this is the output of just formatting a |
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: The corrected reason for the problem is that no-array-7 appears by itself as a node in the input S-expression. |
Huh, interesting… this might be dumb, but should I be surprised that the symbol |
This is completely my mistake; I made a copy and paste error, because the correct initial input should be: |
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? |
Now resolved. |
The output after Egg optimization produces a sequence of Egg expressions nodes that do not correspond to any intended pattern in the conversion back to LLVM IR.
Input:
RecExpr { nodes: [Symbol("no-array-name7"), Symbol("1,"), Get([0, 1]), Add([2, 0]), Symbol("no-array-name8"), Symbol("2,"), Get([4, 5]), Symbol("no-temp-name6"), Mul([6, 7]), Symbol("no-array-name9"), Symbol("2,"), Get([9, 10]), Add([11, 8]), Symbol("no-array-name10"), Symbol("3,"), Get([13, 14]), Symbol("no-array-name11"), Symbol("2,"), Get([16, 17]), Mul([15, 18]), Num(0), Vec([3, 12, 19, 20])] }
Output:
[Symbol("no-array-name7"), Symbol("1,"), Get([0, 1]), Symbol("no-array-name9"), Symbol("2,"), Get([3, 4]), Num(0), Num(0), Vec([2, 5, 6, 7]), Num(1), Symbol("no-array-name8"), Symbol("2,"), Get([10, 11]), Symbol("no-array-name10"), Symbol("3,"), Get([13, 14]), Num(1), Vec([9, 12, 15, 16]), Symbol("no-array-name7"), Symbol("no-temp-name6"), Symbol("no-array-name11"), Symbol("2,"), Get([20, 21]), Num(0), Vec([18, 19, 22, 23]), VecMAC([8, 17, 24])]
Error:
thread '<unnamed>' panicked at '"no-array-name7"', src/lib.rs:398:15
Symbol("no-array-name7")
should always be paired with an array offset Symbol Node and a Get Node. In this situation, theSymbol("no-array-name7")
should not exist by itself.The text was updated successfully, but these errors were encountered: