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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 05:07:42 PDT 2021


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:204
+    if (IsBigEndian)
+      ExtIndexC = NumElts.getKnownMinValue() - 1 - ExtIndexC;
+    unsigned ShiftAmountC = ExtIndexC * DestTy->getPrimitiveSizeInBits();
----------------
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.


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

https://reviews.llvm.org/D111082



More information about the llvm-commits mailing list