[llvm] [TTI][RISCV]Improve costs for whole vector reg extract/insert. (PR #80164)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 22:05:22 PST 2024


================
@@ -326,6 +326,18 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
     switch (Kind) {
     default:
       break;
+    case TTI::SK_InsertSubvector:
+      if (auto *FSubTy = dyn_cast<FixedVectorType>(SubTp)) {
----------------
lukel97 wrote:

Sorry just noticing this now, I think this should be a cast since it shouldn't be possible to insert a scalable `SubTp` into `Tp`
```suggestion
      auto *FSubTy = cast<FixedVectorType>(SubTp);
```

https://github.com/llvm/llvm-project/pull/80164


More information about the llvm-commits mailing list