[PATCH] D99412: [AArch64][SVEIntrinsicOpts] Optimize tbl+dup into dup+extractelement

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 26 04:31:06 PDT 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp:466-467
+  auto *Extract = Builder.CreateExtractElement(OpVal, SplatValue);
+  auto *NewDupX =
+      Builder.CreateIntrinsic(Intrinsic::aarch64_sve_dup_x, {VTy}, {Extract});
+
----------------
Can you use `Builder.CreateVectorSplat` here?


================
Comment at: llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp:469-470
+
+  I->replaceAllUsesWith(NewDupX);
+  I->eraseFromParent();
+  return true;
----------------
I'm never really sure what to do in these instances but do we need to worry about the original DupXIntrI?  Given we know its operand is constant it's easily removed if this was the only use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99412



More information about the llvm-commits mailing list