mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
MemCpyOptimizer: Use max legal int size instead of pointer size
If there are no legal integers, assume 1 byte. This makes more sense than using the pointer size as a guess for the maximum GPR width. It is conceivable to want to use some 64-bit pointers on a target where 64-bit integers aren't legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190817 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -629,6 +629,13 @@ Type *DataLayout::getSmallestLegalIntType(LLVMContext &C, unsigned Width) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned DataLayout::getLargestLegalIntTypeSize() const {
|
||||
unsigned MaxWidth = 0;
|
||||
for (unsigned i = 0, e = (unsigned)LegalIntWidths.size(); i != e; ++i)
|
||||
MaxWidth = std::max<unsigned>(MaxWidth, LegalIntWidths[i]);
|
||||
return MaxWidth;
|
||||
}
|
||||
|
||||
uint64_t DataLayout::getIndexedOffset(Type *ptrTy,
|
||||
ArrayRef<Value *> Indices) const {
|
||||
Type *Ty = ptrTy;
|
||||
|
||||
Reference in New Issue
Block a user