[PATCH] D111082: [InstCombine] fold fake vector extract to shift+trunc

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 13:04:58 PDT 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:204
+    if (IsBigEndian)
+      ExtIndexC = NumElts.getKnownMinValue() - 1 - ExtIndexC;
+    unsigned ShiftAmountC = ExtIndexC * DestTy->getPrimitiveSizeInBits();
----------------
spatel wrote:
> dmgreen wrote:
> > Does this need to check for scalable vectors nowadays?
> The source type must be a scalar integer, so we can't have a scalable vector in this code block, right?
> If that's correct, I can add an assert that we have a FixedVectorType.
Ah, because it's from a bitcast. Sounds good then.


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

https://reviews.llvm.org/D111082



More information about the llvm-commits mailing list