[llvm] [AArch64][GlobalISel] Perfect Shuffles (PR #106446)
Dhruv Chawla via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 21:00:26 PDT 2024
================
@@ -504,6 +504,189 @@ void applyINS(MachineInstr &MI, MachineRegisterInfo &MRI,
MI.eraseFromParent();
}
+/// Match 4 elemental G_SHUFFLE_VECTOR
+bool matchPerfectShuffle(MachineInstr &MI, MachineRegisterInfo &MRI) {
+ assert(MI.getOpcode() == TargetOpcode::G_SHUFFLE_VECTOR);
+ return MRI.getType(MI.getOperand(0).getReg()).getNumElements() == 4;
+}
+
+static Register GeneratePerfectShuffle(unsigned ID, Register V1, Register V2,
----------------
dc03-work wrote:
```suggestion
static Register generatePerfectShuffle(unsigned ID, Register V1, Register V2,
```
nit: function name.
https://github.com/llvm/llvm-project/pull/106446
More information about the llvm-commits
mailing list