[PATCH] D101900: [InstCombine] Fold extractelement + vector GEP with one use

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 05:55:01 PDT 2021


david-arm marked 3 inline comments as done.
david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:450
+          Value *NewPtr = nullptr, *NewIdx = nullptr;
+          if (VecType->getElementType() == GEP->getPointerOperandType()) {
+            assert(isa<VectorType>(IdxType) &&
----------------
sdesmalen wrote:
> You can probably avoid spelling out the three possibilities and just have a loop that extracts the operand if it's type is a VectorType, as long as you make sure only one of the operands is of type VectorType.
I've changed this to a loop, but I left in some comments as examples of different cases we might hit as I thought that might be useful to explain what's going on?


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

https://reviews.llvm.org/D101900



More information about the llvm-commits mailing list