AnyDSL / thorin

The Higher-Order Intermediate Representation
https://anydsl.github.io
GNU Lesser General Public License v3.0
151 stars 15 forks source link

Mem2reg #97

Closed leissa closed 5 years ago

leissa commented 5 years ago

removes SSA construction stuff and just relies on the resolve_loads.

madmann91 commented 5 years ago

I suggest you try the following code, it's quite funny:

extern "C" { fn printf(&[u8]) -> (); }
fn main() -> () {
    if !true { printf("If this is executed, all is lost\n"); }
}

More seriously, the allset function is broken for booleans. That was the bug. The transformation from xor to or performed by LLVM is actually correct (only the highest bit is changed in fact).

leissa commented 5 years ago

Ah, i see. That was a tough one. A miracle that this problem didn't pop up earlier :)

leissa commented 5 years ago

Can you give the dead_load_opt another shot on your code?

madmann91 commented 5 years ago

Everything seems to work but there are still moderate/severe performance regressions for GPU code. I am looking into this.

madmann91 commented 5 years ago

Merged.