[llvm] GlobalISel lane masks merging (PR #73337)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 05:32:12 PST 2023
================
@@ -207,7 +207,39 @@ bool AMDGPUInstructionSelector::selectCOPY(MachineInstr &I) const {
return true;
}
+bool isLaneMask(Register Reg, MachineRegisterInfo *MRI,
+ const SIRegisterInfo &TRI) {
+ if (MRI->getType(Reg) != LLT::scalar(1))
+ return false;
+ const TargetRegisterClass *RC = MRI->getRegClassOrNull(Reg);
+ if (!RC || !TRI.isSGPRClass(RC))
+ return false;
+
+ return true;
+}
+
+// PHI where all register operands are sgpr(register class) with S1 LLT.
+bool isLaneMaskPhi(MachineInstr &I, MachineRegisterInfo *MRI,
+ const SIRegisterInfo &TRI) {
+ if (I.getOpcode() != AMDGPU::PHI)
----------------
arsenm wrote:
G_PHI. Not sure we should bother handling non-G_* phi at all, but isPHI also works
https://github.com/llvm/llvm-project/pull/73337
More information about the llvm-commits
mailing list