[PATCH] D74976: [CostModel][X86] Improve extract/insert element costs (PR43605)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 05:22:11 PST 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:2449
+
+    // Assume pinsertps is relatively cheap on all targets.
+    if (MScalarTy == MVT::f32 && ST->hasSSE41())
----------------
insertps/extractps


================
Comment at: llvm/test/Analysis/CostModel/X86/vector-extract.ll:41
+; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_3 = extractelement <8 x double> undef, i32 3
 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64_4 = extractelement <8 x double> undef, i32 4
+; AVX-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v8f64_7 = extractelement <8 x double> undef, i32 7
----------------
Hm, why is this cost=0, don't we need to extract 3'th sub-register here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74976/new/

https://reviews.llvm.org/D74976





More information about the llvm-commits mailing list