mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Don't assert in BasicTTI::getMemoryOpCost for non-simple types
BasicTTI::getMemoryOpCost must explicitly check for non-simple types; setting AllowUnknown=true with TLI->getSimpleValueType is not sufficient because, for example, non-power-of-two vector types return non-simple EVTs (not MVT::Other). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206150 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -424,12 +424,14 @@ unsigned BasicTTI::getMemoryOpCost(unsigned Opcode, Type *Src,
|
||||
// This is a vector load that legalizes to a larger type than the vector
|
||||
// itself. Unless the corresponding extending load or truncating store is
|
||||
// legal, then this will scalarize.
|
||||
TargetLowering::LegalizeAction LA;
|
||||
MVT MemVT = getTLI()->getSimpleValueType(Src, true);
|
||||
if (Opcode == Instruction::Store)
|
||||
LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
|
||||
else
|
||||
LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, MemVT);
|
||||
TargetLowering::LegalizeAction LA = TargetLowering::Expand;
|
||||
EVT MemVT = getTLI()->getValueType(Src, true);
|
||||
if (MemVT.isSimple() && MemVT != MVT::Other) {
|
||||
if (Opcode == Instruction::Store)
|
||||
LA = getTLI()->getTruncStoreAction(LT.second, MemVT.getSimpleVT());
|
||||
else
|
||||
LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, MemVT.getSimpleVT());
|
||||
}
|
||||
|
||||
if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
|
||||
// This is a vector load/store for some illegal type that is scalarized.
|
||||
|
Reference in New Issue
Block a user