[llvm-dev] GEP transformation by InstCombiner

Demikhovsky, Elena via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 15 10:21:15 PST 2018


       Hi all,

       I'm working on an out-of-tree target and encountered the following problem:

       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 I assume that all registered targets do this.

       The target I'm working on has very restricted ISA for the pointer calculation:
       ptr + int,   ptr - int,    ptr - ptr    and   ptr-compare

       I have full arithmetic set for 32-bit integers, but the Ptr is wider. Extending index to the Ptr width requires full arithmetic support for pointers.
       But, actually, it does not come from C-sources (casting Ptr to int means truncation).

       I'd like to add TTI (TargetTransformInfo) to InstCombiner in order to configure the width of GEP indices.
       The current default behavior will be preserved.
       What do you think?

       Thanks.

-        Elena



---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180115/c915e03b/attachment.html>


More information about the llvm-dev mailing list