diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:10 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:10 +0000 |
| commit | 93c91e39b29142dec1d03a30df9f6e757f56c193 (patch) | |
| tree | 33a9b014a327e64450b3c9ed46d8c5bdb78ad345 /include/llvm/Analysis/TargetTransformInfoImpl.h | |
| parent | ca089b24d48ef6fa8da2d0bb8c25bb802c4a95c0 (diff) | |
Notes
Diffstat (limited to 'include/llvm/Analysis/TargetTransformInfoImpl.h')
| -rw-r--r-- | include/llvm/Analysis/TargetTransformInfoImpl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/TargetTransformInfoImpl.h b/include/llvm/Analysis/TargetTransformInfoImpl.h index 8740ee92eed5..0b07fe9aa232 100644 --- a/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -120,6 +120,10 @@ public: return SI.getNumCases(); } + int getExtCost(const Instruction *I, const Value *Src) { + return TTI::TCC_Basic; + } + unsigned getCallCost(FunctionType *FTy, int NumArgs) { assert(FTy && "FunctionType must be provided to this routine."); @@ -728,6 +732,8 @@ public: // nop on most sane targets. if (isa<CmpInst>(CI->getOperand(0))) return TTI::TCC_Free; + if (isa<SExtInst>(CI) || isa<ZExtInst>(CI) || isa<FPExtInst>(CI)) + return static_cast<T *>(this)->getExtCost(CI, Operands.back()); } return static_cast<T *>(this)->getOperationCost( |
