liberty/lib/SLAMP/SLAMP.cpp
/// get the size of the load or store instruction based on the type
get the size of the load or store instruction based on the type
get the size of the load or store instruction based on the type
int SLAMP::getIndex(PointerType *ty, size_t &size, const DataLayout &DL) {
  int i = DL.getTypeStoreSizeInBits(ty->getElementType());
  if (isa<VectorType>(ty->getElementType())) {
    size = i / 8;
    return 4;
  }
  switch (i) {
  case 8:
    return 0;
  case 16:
    return 1;
  case 32:
    return 2;
  case 64:
    return 3;
  default:
    size = i / 8;
    return 4;
  }
}
int SLAMP :: getIndex ( PointerType * ty , size_t & size , const DataLayout & DL ) { int i = DL . getTypeStoreSizeInBits ( ty -> getElementType ( ) ) ; if ( isa < VectorType > ( ty -> getElementType ( ) ) ) { size = i / 8 ; return 4 ; } switch ( i ) { case 8 : return 0 ; case 16 : return 1 ; case 32 : return 2 ; case 64 : return 3 ; default : size = i / 8 ; return 4 ; } }
get the size of the load or store instruction based on the type
get the size of the load or store instruction based on the type
// sot: cannot convert a vector value to an int64 so just return variable size // n (index 4) and return the actual size, even if i is less than or equal // to 64.