[PATCH] D125951: [InstCombine] bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest)

Chenbing.Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 28 21:31:47 PDT 2022


Chenbing.Zheng marked 2 inline comments as done.
Chenbing.Zheng added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:2375
+  // bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest)
+  if (DestType->isVectorTy() && !VecType->isScalableVectorTy() &&
+      cast<FixedVectorType>(VecType)->getNumElements() == 1)
----------------
spatel wrote:
> Is there an advantage to adding a new API for this?
> Since we need the casted object anyway, this seems better:
>   auto *FixedVType = dyn_cast<FixedVectorType>(VecType);
>   if (DestType->isVectorTy() && FixedVType && FixedVType->getNumElements() == 1)
Done and thanks for your advice~


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125951



More information about the llvm-commits mailing list