mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-01 01:30:36 +00:00
Cost Model: teach the cost model about expanding integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
28989889bf
commit
75138f58b0
@ -143,7 +143,8 @@ VectorTargetTransformImpl::getTypeLegalizationCost(LLVMContext &C,
|
|||||||
if (LK.first == TargetLowering::TypeLegal)
|
if (LK.first == TargetLowering::TypeLegal)
|
||||||
return std::make_pair(Cost, Ty.getSimpleVT());
|
return std::make_pair(Cost, Ty.getSimpleVT());
|
||||||
|
|
||||||
if (LK.first == TargetLowering::TypeSplitVector)
|
if (LK.first == TargetLowering::TypeSplitVector ||
|
||||||
|
LK.first == TargetLowering::TypeExpandInteger)
|
||||||
Cost *= 2;
|
Cost *= 2;
|
||||||
|
|
||||||
// Keep legalizing the type.
|
// Keep legalizing the type.
|
||||||
@ -300,7 +301,7 @@ unsigned VectorTargetTransformImpl::getCmpSelInstrCost(unsigned Opcode,
|
|||||||
unsigned Cost = getCmpSelInstrCost(Opcode, ValTy->getScalarType(),
|
unsigned Cost = getCmpSelInstrCost(Opcode, ValTy->getScalarType(),
|
||||||
CondTy);
|
CondTy);
|
||||||
|
|
||||||
// return the cost of multiple scalar invocation plus the cost of inserting
|
// Return the cost of multiple scalar invocation plus the cost of inserting
|
||||||
// and extracting the values.
|
// and extracting the values.
|
||||||
return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
|
return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
|
||||||
}
|
}
|
||||||
|
9
test/Analysis/CostModel/X86/i32.ll
Normal file
9
test/Analysis/CostModel/X86/i32.ll
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
; RUN: opt < %s -cost-model -analyze -mtriple=i386 -mcpu=corei7-avx | FileCheck %s
|
||||||
|
|
||||||
|
|
||||||
|
;CHECK: cost of 2 {{.*}} add
|
||||||
|
;CHECK: cost of 1 {{.*}} ret
|
||||||
|
define i32 @no_info(i32 %arg) {
|
||||||
|
%e = add i64 undef, undef
|
||||||
|
ret i32 undef
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user