[PATCH] D97835: [AArch64][GlobalISel] Add combine for extract_vector_elt(build_vector, cst)

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 09:59:37 PST 2021


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3665-3668
+  MachineInstr *BuildVecMI =
+      getOpcodeDef(TargetOpcode::G_BUILD_VECTOR, SrcVec, MRI);
+  if (!BuildVecMI)
+    return false;
----------------
arsenm wrote:
> What about G_BUILD_VECTOR_TRUNC?
> 
> This also probably should check for legality / before legalize. The DAG version also has this hasOneUseCheck:
> 
> ```
>       (VecOp.hasOneUse() || TLI.aggressivelyPreferBuildVectorSources(VecVT))) {
> ```
> 
> What about G_BUILD_VECTOR_TRUNC?
We'd have to insert a scalar truncate, which the dagcombine doesn't seem to do. I can try it though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97835



More information about the llvm-commits mailing list