@@ -144,50 +144,6 @@ class TargetTransformInfoImplBase {
144
144
return TTI::TCC_Expensive;
145
145
}
146
146
147
- unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy,
148
- ArrayRef<Type *> ParamTys, const User *U) {
149
- switch (IID) {
150
- default :
151
- // Intrinsics rarely (if ever) have normal argument setup constraints.
152
- // Model them as having a basic instruction cost.
153
- return TTI::TCC_Basic;
154
-
155
- // TODO: other libc intrinsics.
156
- case Intrinsic::memcpy :
157
- return getMemcpyCost (dyn_cast<Instruction>(U));
158
-
159
- case Intrinsic::annotation:
160
- case Intrinsic::assume:
161
- case Intrinsic::sideeffect:
162
- case Intrinsic::dbg_declare:
163
- case Intrinsic::dbg_value:
164
- case Intrinsic::dbg_label:
165
- case Intrinsic::invariant_start:
166
- case Intrinsic::invariant_end:
167
- case Intrinsic::launder_invariant_group:
168
- case Intrinsic::strip_invariant_group:
169
- case Intrinsic::is_constant:
170
- case Intrinsic::lifetime_start:
171
- case Intrinsic::lifetime_end:
172
- case Intrinsic::objectsize:
173
- case Intrinsic::ptr_annotation:
174
- case Intrinsic::var_annotation:
175
- case Intrinsic::experimental_gc_result:
176
- case Intrinsic::experimental_gc_relocate:
177
- case Intrinsic::coro_alloc:
178
- case Intrinsic::coro_begin:
179
- case Intrinsic::coro_free:
180
- case Intrinsic::coro_end:
181
- case Intrinsic::coro_frame:
182
- case Intrinsic::coro_size:
183
- case Intrinsic::coro_suspend:
184
- case Intrinsic::coro_param:
185
- case Intrinsic::coro_subfn_addr:
186
- // These intrinsics don't actually represent code after lowering.
187
- return TTI::TCC_Free;
188
- }
189
- }
190
-
191
147
bool hasBranchDivergence () { return false ; }
192
148
193
149
bool isSourceOfDivergence (const Value *V) { return false ; }
@@ -786,7 +742,49 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
786
742
return TTI::TCC_Basic;
787
743
}
788
744
789
- using BaseT::getIntrinsicCost;
745
+ unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy,
746
+ ArrayRef<Type *> ParamTys, const User *U) {
747
+ switch (IID) {
748
+ default :
749
+ // Intrinsics rarely (if ever) have normal argument setup constraints.
750
+ // Model them as having a basic instruction cost.
751
+ return TTI::TCC_Basic;
752
+
753
+ // TODO: other libc intrinsics.
754
+ case Intrinsic::memcpy :
755
+ return static_cast <T *>(this )->getMemcpyCost (dyn_cast<Instruction>(U));
756
+
757
+ case Intrinsic::annotation:
758
+ case Intrinsic::assume:
759
+ case Intrinsic::sideeffect:
760
+ case Intrinsic::dbg_declare:
761
+ case Intrinsic::dbg_value:
762
+ case Intrinsic::dbg_label:
763
+ case Intrinsic::invariant_start:
764
+ case Intrinsic::invariant_end:
765
+ case Intrinsic::launder_invariant_group:
766
+ case Intrinsic::strip_invariant_group:
767
+ case Intrinsic::is_constant:
768
+ case Intrinsic::lifetime_start:
769
+ case Intrinsic::lifetime_end:
770
+ case Intrinsic::objectsize:
771
+ case Intrinsic::ptr_annotation:
772
+ case Intrinsic::var_annotation:
773
+ case Intrinsic::experimental_gc_result:
774
+ case Intrinsic::experimental_gc_relocate:
775
+ case Intrinsic::coro_alloc:
776
+ case Intrinsic::coro_begin:
777
+ case Intrinsic::coro_free:
778
+ case Intrinsic::coro_end:
779
+ case Intrinsic::coro_frame:
780
+ case Intrinsic::coro_size:
781
+ case Intrinsic::coro_suspend:
782
+ case Intrinsic::coro_param:
783
+ case Intrinsic::coro_subfn_addr:
784
+ // These intrinsics don't actually represent code after lowering.
785
+ return TTI::TCC_Free;
786
+ }
787
+ }
790
788
791
789
unsigned getIntrinsicCost (Intrinsic::ID IID, Type *RetTy,
792
790
ArrayRef<const Value *> Arguments, const User *U) {
0 commit comments