[llvm] [GlobalISel][AArch64] Combine unmerge(G_EXT v, undef) to unmerge(v). (PR #65263)
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 5 04:00:09 PDT 2023
================
@@ -1067,6 +1067,53 @@ void applyVectorSextInReg(MachineInstr &MI, MachineRegisterInfo &MRI,
Helper.lower(MI, 0, /* Unused hint type */ LLT());
}
+/// Combine <N x t>, unused = unmerge(G_EXT <2*N x t> v, undef, N)
+/// => unused, <N x t> = unmerge v
+bool matchUnmergeExtToUnmerge(MachineInstr &MI, MachineRegisterInfo &MRI,
+ Register &MatchInfo) {
+ assert(MI.getOpcode() == TargetOpcode::G_UNMERGE_VALUES);
+ if (MI.getNumDefs() != 2)
+ return false;
+ if (!MRI.use_nodbg_empty(MI.getOperand(1).getReg()))
+ return false;
+
+ LLT DstTy = MRI.getType(MI.getOperand(0).getReg());
+ if (!DstTy.isVector())
+ return false;
+
+ MachineInstr *Ext = getDefIgnoringCopies(
----------------
aemerson wrote:
getOpcodeDef() with the GUnmerge source reg helper here?
https://github.com/llvm/llvm-project/pull/65263
More information about the llvm-commits
mailing list