[PATCH] D138185: [InstCombine] Look through bitcast if possible

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 07:46:52 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:576-578
+          isa<FixedVectorType>(BitCastSrc->getType()) &&
+          cast<FixedVectorType>(BitCastSrc->getType())->getNumElements() ==
+              NumElts) {
----------------
ruiling wrote:
> arsenm wrote:
> > Is there not a more convenient way in PatternMatch to check for matching fixed elements?
> Sorry I don't have a good idea to simplify the code. Please let me know if you have a good suggestion.
dyn_cast instead of isa+cast, but There probably should be a helper to check this somewhere


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138185



More information about the llvm-commits mailing list