Open Commaster opened 5 years ago
Thanks for the detailed report. I will need a test_rv test to reproduce this. Maybe you can leverage the existing memcpy test launcher.
I'm still working on converting this test case into a test suite. For now, the module IR that RV receives: https://gist.github.com/Commaster/c8cb1928c22a2b77e358c48c01eb5163
I tried setting https://github.com/cdl-saarland/rv/blob/develop/src/transform/memCopyElision.cpp#L61 as the first check instead of last, which let the pass finish.
I also checked other calls to CreateGEP. Calls with basic types (i8, float, etc..) have only 1 index, calls for complex types (Arrays, structures) have 2 or more. I suspect the issue here is that the common type gets decayed to a basic type, but still supplied with two indexes (https://github.com/cdl-saarland/rv/blob/develop/src/transform/memCopyElision.cpp#L107)