mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
SelectionDAG: Use correct pointer size when lowering function arguments v2
This adds minimal support to the SelectionDAG for handling address spaces with different pointer sizes. The SelectionDAG should now correctly lower pointer function arguments to the correct size as well as generate the correct code when lowering getelementptr. This patch also updates the R600 DataLayout to use 32-bit pointers for the local address space. v2: - Add more helper functions to TargetLoweringBase - Use CHECK-LABEL for tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -767,6 +767,19 @@ void TargetLoweringBase::initActions() {
|
||||
setOperationAction(ISD::DEBUGTRAP, MVT::Other, Expand);
|
||||
}
|
||||
|
||||
MVT TargetLoweringBase::getPointerTy(uint32_t AS) const {
|
||||
return MVT::getIntegerVT(getPointerSizeInBits(AS));
|
||||
}
|
||||
|
||||
unsigned TargetLoweringBase::getPointerSizeInBits(uint32_t AS) const {
|
||||
return TD->getPointerSizeInBits(AS);
|
||||
}
|
||||
|
||||
unsigned TargetLoweringBase::getPointerTypeSizeInBits(Type *Ty) const {
|
||||
assert(Ty->isPointerTy());
|
||||
return getPointerSizeInBits(Ty->getPointerAddressSpace());
|
||||
}
|
||||
|
||||
MVT TargetLoweringBase::getScalarShiftAmountTy(EVT LHSTy) const {
|
||||
return MVT::getIntegerVT(8*TD->getPointerSize(0));
|
||||
}
|
||||
|
Reference in New Issue
Block a user