Page MenuHomePhabricator

[SROA] Use offset sizes from the DataLayout instead of the pointer siezes.

Authored by Nicola on Sep 27 2018, 5:27 AM.



This fixes an assertion when constant folding a GEP when the part of the offset was in i32 (IndexSize, as per DataLayout) and part in the i64 (PointerSize) in the newly created test case.

Diff Detail


Event Timeline

Nicola created this revision.Sep 27 2018, 5:27 AM

Please use FileCheck to check that the output is actually what you expect, in addition to not crashing.

I'm ok with the code itself. I agree with Eli that you should add CHECKs.

Nicola updated this revision to Diff 171663.Oct 30 2018, 4:06 AM

Changed the test to return a value and keep alive the interesting GEP

delena accepted this revision.Oct 30 2018, 4:12 AM
This revision is now accepted and ready to land.Oct 30 2018, 4:12 AM
This revision was automatically updated to reflect the committed changes.