-
Notifications
You must be signed in to change notification settings - Fork 224
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
Disabling optimization when generating IR #579
Comments
Unfortunately WALA IR invariants require this optimization, so there is no way to disable it. Hopefully with source mapping information and ASTs you can recover what you need. |
Then is it possible to prevent a variable to be optimized out? I am currently trying to converting python code to WALA IR (based on Ariadne). But I found global variable is optimized out and causes incorrect code: g = 5
def test_global():
global g
g = 10
print(g)
test_global()
print(g) WALA IR:
The variable g should not be optimized, otherwise the output is wrong. Or is there any other way to fix this issue? |
I don't know the Python frontend at all, but this sounds like a bug. @juliandolby? |
I'm not seeing this problem in wala/ML#101. In that test file, we have And, in the test code that passes, we are finding |
I tested a small program and found that some statements are optimized out when I print the IR. I can see those statements in the CAst. So I guess the optimization happens during the IR generation phase. Does anyone know how to disable them? In my case currently I need to get all IR for debugging purpose.
The text was updated successfully, but these errors were encountered: