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

Elena Demikhovsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 05:19:08 PST 2018


delena added a comment.

I looked at your code:
/// Return the size in bits of the specified type, for which isSCEVable must
/// return true.
uint64_t ScalarEvolution::getTypeSizeInBits(Type *Ty) const {

  assert(isSCEVable(Ty) && "Type is not SCEVable!");
  const DataLayout &DL = getDataLayout();
  if (PointerType *PT = dyn_cast<PointerType>(Ty))
    return DL.getPointerBaseSizeInBits(PT->getPointerAddressSpace());
  return DL.getTypeSizeInBits(Ty);

}
I can't say that size of pointer is smaller that it is. I can't truncate pointer to integer in order to expand all SCEV expressions.


Repository:
  rL LLVM

https://reviews.llvm.org/D42123





More information about the llvm-commits mailing list