mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-20 09:24:58 +00:00
refactor some code into a helper method, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6bdcda3d3e
commit
81249c95ce
@ -4453,6 +4453,42 @@ struct VISIBILITY_HIDDEN SDISelAsmOperandInfo :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getCallOperandValMVT - Return the MVT of the Value* that this operand
|
||||||
|
/// corresponds to. If there is no Value* for this operand, it returns
|
||||||
|
/// MVT::Other.
|
||||||
|
MVT getCallOperandValMVT(const TargetLowering &TLI,
|
||||||
|
const TargetData *TD) const {
|
||||||
|
if (CallOperandVal == 0) return MVT::Other;
|
||||||
|
|
||||||
|
if (isa<BasicBlock>(CallOperandVal))
|
||||||
|
return TLI.getPointerTy();
|
||||||
|
|
||||||
|
const llvm::Type *OpTy = CallOperandVal->getType();
|
||||||
|
|
||||||
|
// If this is an indirect operand, the operand is a pointer to the
|
||||||
|
// accessed type.
|
||||||
|
if (isIndirect)
|
||||||
|
OpTy = cast<PointerType>(OpTy)->getElementType();
|
||||||
|
|
||||||
|
// If OpTy is not a single value, it may be a struct/union that we
|
||||||
|
// can tile with integers.
|
||||||
|
if (!OpTy->isSingleValueType() && OpTy->isSized()) {
|
||||||
|
unsigned BitSize = TD->getTypeSizeInBits(OpTy);
|
||||||
|
switch (BitSize) {
|
||||||
|
default: break;
|
||||||
|
case 1:
|
||||||
|
case 8:
|
||||||
|
case 16:
|
||||||
|
case 32:
|
||||||
|
case 64:
|
||||||
|
OpTy = IntegerType::get(BitSize);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TLI.getValueType(OpTy, true);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// MarkRegAndAliases - Mark the specified register and all aliases in the
|
/// MarkRegAndAliases - Mark the specified register and all aliases in the
|
||||||
/// specified set.
|
/// specified set.
|
||||||
@ -4707,34 +4743,13 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
|
|||||||
// If this is an input or an indirect output, process the call argument.
|
// If this is an input or an indirect output, process the call argument.
|
||||||
// BasicBlocks are labels, currently appearing only in asm's.
|
// BasicBlocks are labels, currently appearing only in asm's.
|
||||||
if (OpInfo.CallOperandVal) {
|
if (OpInfo.CallOperandVal) {
|
||||||
if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal))
|
if (BasicBlock *BB = dyn_cast<BasicBlock>(OpInfo.CallOperandVal)) {
|
||||||
OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
|
OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
|
||||||
else {
|
} else {
|
||||||
OpInfo.CallOperand = getValue(OpInfo.CallOperandVal);
|
OpInfo.CallOperand = getValue(OpInfo.CallOperandVal);
|
||||||
const Type *OpTy = OpInfo.CallOperandVal->getType();
|
|
||||||
// If this is an indirect operand, the operand is a pointer to the
|
|
||||||
// accessed type.
|
|
||||||
if (OpInfo.isIndirect)
|
|
||||||
OpTy = cast<PointerType>(OpTy)->getElementType();
|
|
||||||
|
|
||||||
// If OpTy is not a single value, it may be a struct/union that we
|
|
||||||
// can tile with integers.
|
|
||||||
if (!OpTy->isSingleValueType() && OpTy->isSized()) {
|
|
||||||
unsigned BitSize = TD->getTypeSizeInBits(OpTy);
|
|
||||||
switch (BitSize) {
|
|
||||||
default: break;
|
|
||||||
case 1:
|
|
||||||
case 8:
|
|
||||||
case 16:
|
|
||||||
case 32:
|
|
||||||
case 64:
|
|
||||||
OpTy = IntegerType::get(BitSize);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OpVT = TLI.getValueType(OpTy, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OpVT = OpInfo.getCallOperandValMVT(TLI, TD);
|
||||||
}
|
}
|
||||||
|
|
||||||
OpInfo.ConstraintVT = OpVT;
|
OpInfo.ConstraintVT = OpVT;
|
||||||
|
Loading…
Reference in New Issue
Block a user