<commit_before>//===-- TargetMachine.cpp - General Target Information ---------------------==//
//
// This file describes the general parts of a Target machine.
// This file also implements TargetCacheInfo.
//
//===----------------------------------------------------------------------===//

#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetCacheInfo.h"
#include "llvm/Type.h"

//---------------------------------------------------------------------------
// class TargetMachine
// 
// Purpose:
//   Machine description.
// 
//---------------------------------------------------------------------------


// function TargetMachine::findOptimalStorageSize 
// 
// Purpose:
//   This default implementation assumes that all sub-word data items use
//   space equal to optSizeForSubWordData, and all other primitive data
//   items use space according to the type.
//   
unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
  // Round integral values smaller than SubWordDataSize up to SubWordDataSize
  if (Ty->isIntegral() &&
      Ty->getPrimitiveSize() < DataLayout.getSubWordDataSize())
    return DataLayout.getSubWordDataSize();

  return DataLayout.getTypeSize(Ty);
}


//---------------------------------------------------------------------------
// class TargetCacheInfo 
// 
// Purpose:
//   Describes properties of the target cache architecture.
//---------------------------------------------------------------------------

void TargetCacheInfo::Initialize() {
  numLevels = 2;
  cacheLineSizes.push_back(16);  cacheLineSizes.push_back(32); <commit_msg>The promotion rules are the same for all targets, they are set by the C standard.<commit_after>//===-- TargetMachine.cpp - General Target Information ---------------------==//
//
// This file describes the general parts of a Target machine.
// This file also implements TargetCacheInfo.
//
//===----------------------------------------------------------------------===//

#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetCacheInfo.h"
#include "llvm/Type.h"

//---------------------------------------------------------------------------
// class TargetMachine
// 
// Purpose:
//   Machine description.
// 
//---------------------------------------------------------------------------


// function TargetMachine::findOptimalStorageSize 
// 
unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
  // All integer types smaller than ints promote to 4 byte integers.
  if (Ty->isIntegral() && Ty->getPrimitiveSize() < 4)
    return 4;

  return DataLayout.getTypeSize(Ty);
}


//---------------------------------------------------------------------------
// class TargetCacheInfo 
// 
// Purpose:
//   Describes properties of the target cache architecture.
//---------------------------------------------------------------------------

void TargetCacheInfo::Initialize() {
  numLevels = 2;
  cacheLineSizes.push_back(16);  cacheLineSizes.push_back(32); 
{'fraction_non_alphanumeric': 0.35769359704994974, 'fraction_numerical': 0.004358028830036876, 'mean_word_length': 1.3551696921862668, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4795655', 'n_tokens_mistral': 678, 'n_tokens_neox': 664, 'n_words': 186}