[PATCH] D125951: [InstCombine] bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 05:14:41 PDT 2022
spatel 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)
----------------
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)
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