[PATCH] D42123: Derive GEP index type from Data Layout

Elena Demikhovsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 12:06:08 PST 2018


delena created this revision.
delena added reviewers: hfinkel, Ashutosh, theraven, igorb, craig.topper.

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. No tests were added since the target is out of tree. On the other hand, none of the compiled targets are affected by this change.
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D42123

Files:
  include/llvm/IR/DataLayout.h
  lib/IR/DataLayout.cpp
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  lib/Transforms/InstCombine/InstructionCombining.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42123.129964.patch
Type: text/x-patch
Size: 7906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180116/f51b081c/attachment.bin>


More information about the llvm-commits mailing list