-
Notifications
You must be signed in to change notification settings - Fork 488
Obfuscating Loop1 #181
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
Obfuscating Loop1 #181
Conversation
This seemed to have problems before so I might have to go and fix them :) |
ml-proto/test/labels.wast
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is doubling $i on each iteration, so the expected result would be something like 2^8, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, nevermind, I misread the break condition.
LGTM |
What would you think about just adding the new more complex loop as a new test, rather than replacing the existing test? I think there's value in both. |
Done, I added a loop3 then |
The loop1 method is too simple for LLVM, which then makes it return just 5. Though this proves that the code is correct, we probably want to have the code generation all the same. This patch makes a loop3 method based on loop1 so that the code ais bit different but at least the compiler can no longer optimize it all away. We've left loop1 to show the difference in compiler technologies
let me do this again... |
- Fix mistake tests in simd_load.wast - Missing lane index should be malformed - Test more values of lane index
[test] Fix issue WebAssembly#181
The loop1 method is too simple for LLVM, which then makes it return just 5.
Though this proves that the code is correct, we probably want to have the
code generation all the same.
This patch makes the code a bit different but at least the compiler can no
longer optimize it all away.