-
Notifications
You must be signed in to change notification settings - Fork 18
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
Hanging while performing PE. #98
Comments
Maybe the new |
It does but the issue is that it shouldn't: The value of |
OK after inspection it's perfectly correct. In Impala, emission is actually done by value for non mutable EDIT: making |
OK, I have found a simple improvement in By changing the criterion to allow partially safe data in extern "C" {
fn side_effect(&[u8]) -> ();
}
struct FooBar {
foo: i32,
bar: f32
}
extern fn crash_the_compiler(bar: f32) -> () {
let data = make_foobar(bar);
let ptr = &data.bar as &[u8];
let foo = data.foo; // this now works, was not working before
// data.bar is unknown here, since the compiler assumes it might be
// modified by side_effect() -- even if the call happens after...
side_effect(ptr);
// data is completely unknown here
let sum = iterate(42f, foo, @ |x| x + 42f);
}
fn @make_foobar(bar: f32) -> FooBar {
FooBar {
foo: 4,
bar: bar
}
}
fn @iterate(value: f32, n: i32, op: fn (f32) -> f32) -> f32 {
if n > 0 {
iterate(op(value), n - 1, op)
} else {
value
}
} |
To address the issue in the general case, we need a much smarter optimization than The current workaround is the following:
|
Yes, I want to implement the new optimizer in my |
I can confirm that the crash has been removed on From what I gather, this is intended behaviour, since by marking data as immutable, we take on the assumption that the user ensures As a side note, before
Which is even worse than the first example, since |
The following code hangs on
master
. Compile withimpala -emit-thorin
. It works onmem2reg
, so maybe backporting fixes will be enough.The text was updated successfully, but these errors were encountered: