[PATCH] D126885: [SLP]Cost for a constant buildvector.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 03:32:03 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3807
+  case Instruction::FCmp:
+    if (Idx == 1)
+      return TTI::TCC_Free;
----------------
Instruction::Add/Sub?

Also, we'd need to allow Idx ==0 || Idx == 1 for commutable ops.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3787
+  case Instruction::AShr:
+    if (Idx == 1)
+      return TTI::TCC_Free;
----------------
vdmitrie wrote:
> Note that it is free for splat shift value only.
> https://godbolt.org/z/KMf6sW5n3
Yes, vector shifts must be splats without AVX2 or XOP


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126885



More information about the llvm-commits mailing list