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

David Chisnall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 04:20:57 PST 2018


theraven requested changes to this revision.
theraven added a comment.
This revision now requires changes to proceed.

I don't like this patch as is, for several reasons.

1. It's adding a hack that assumes that the offset should be the width of the widest integer operation.  This is probably true in most cases (it is for us), but if we're going to introduce the idea that an address offset is distinct from the size of the pointer then we should do it properly and add that to the TargetInfo string explicitly (defaulting to the same size, if not specified).
2. We're computing the correct width every time it's requested, which looks expensive.  TargetInfo should store the width for each address space and, for non-vector types, not have to do any calculation to determine the kind of integer to return.
3. It fixes only around 20% of the places that we've found that assume that the size and range of the pointer are the same.


Repository:
  rL LLVM

https://reviews.llvm.org/D42123





More information about the llvm-commits mailing list