In the current version InstCombiner “normalizes” GEPs and extends Index operand to the pointer width.
It works fine if you can convert pointer to integer for address calculation and all registered targets do this.
The target I’m working on has very restricted ISA for the pointer calculation. Hal suggested to retrieve information for GEP index width from Data Layout.
http://lists.llvm.org/pipermail/llvm-dev/2018-January/120416.html
I added the interface to Data Layout and I changed the InstCombiner.
I know that I didn't touch all GEP creation points, but all changes that you see in the review are covered by our internal test system.
Can you put curly braces after this if and the for loop below it to help with readability? I know the for loop didn't have them before, but I feel like it should have. I tend to think that if the inner scope is curly braced, the outer scope should be too.