mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-19 17:31:55 +00:00
[CostModel] Follow-up to buildbot fix
Adding type checks into the other backends that call getTypeLegalizationCost. Differential Revision: https://reviews.llvm.org/D80984
This commit is contained in:
parent
f74523f986
commit
5b5e78ad2b
@ -675,6 +675,11 @@ int AArch64TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Ty,
|
||||
if (CostKind != TTI::TCK_RecipThroughput)
|
||||
return 1;
|
||||
|
||||
// Type legalization can't handle structs
|
||||
if (TLI->getValueType(DL, Ty, true) == MVT::Other)
|
||||
return BaseT::getMemoryOpCost(Opcode, Ty, Alignment, AddressSpace,
|
||||
CostKind);
|
||||
|
||||
auto LT = TLI->getTypeLegalizationCost(DL, Ty);
|
||||
|
||||
if (ST->isMisaligned128StoreSlow() && Opcode == Instruction::Store &&
|
||||
|
@ -882,6 +882,11 @@ int ARMTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
|
||||
if (CostKind != TTI::TCK_RecipThroughput)
|
||||
return 1;
|
||||
|
||||
// Type legalization can't handle structs
|
||||
if (TLI->getValueType(DL, Src, true) == MVT::Other)
|
||||
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
|
||||
CostKind);
|
||||
|
||||
std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, Src);
|
||||
|
||||
if (ST->hasNEON() && Src->isVectorTy() &&
|
||||
|
@ -3002,6 +3002,11 @@ int X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
|
||||
}
|
||||
}
|
||||
|
||||
// Type legalization can't handle structs
|
||||
if (TLI->getValueType(DL, Src, true) == MVT::Other)
|
||||
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
|
||||
CostKind);
|
||||
|
||||
// Legalize the type.
|
||||
std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, Src);
|
||||
assert((Opcode == Instruction::Load || Opcode == Instruction::Store) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user