[llvm] [AArch64] Fix MatchDup Lane Out Of Range In AArch64 (PR #101275)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 00:10:52 PDT 2024


================
@@ -288,10 +288,17 @@ bool matchDupFromBuildVector(int Lane, MachineInstr &MI,
                              MachineRegisterInfo &MRI,
                              ShuffleVectorPseudo &MatchInfo) {
   assert(Lane >= 0 && "Expected positive lane?");
+  int NumElements = MRI.getType(MI.getOperand(1).getReg()).getNumElements();
   // Test if the LHS is a BUILD_VECTOR. If it is, then we can just reference the
   // lane's definition directly.
   auto *BuildVecMI = getOpcodeDef(TargetOpcode::G_BUILD_VECTOR,
                                   MI.getOperand(1).getReg(), MRI);
----------------
cceerczw wrote:

Done

https://github.com/llvm/llvm-project/pull/101275


More information about the llvm-commits mailing list