[llvm] Allow Specifying SGMasks for Inline Asm (PR #155491)
Patrick Simmons via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 14 14:39:48 PDT 2025
================
@@ -2391,6 +2391,61 @@ bool SchedGroup::canAddMI(const MachineInstr &MI) const {
if (MI.isMetaInstruction())
Result = false;
+ else if (MI.isInlineAsm()) {
+ auto &TRI = TII->getRegisterInfo();
+ auto &MRI = MI.getParent()->getParent()->getRegInfo();
+ bool SGPR_used = false, VGPR_used = false, VMFMA_used = false,
+ MayLoad = MI.mayLoad(), MayStore = MI.mayStore();
+ for (const MachineOperand &Operand : MI.operands())
+ if (Operand.isReg()) {
+ auto &RegClass = *TRI.getRegClassForOperandReg(MRI, Operand);
+ if (TRI.isVGPRClass(&RegClass))
+ VGPR_used = true;
+ if (TRI.isAGPRClass(&RegClass) || TRI.getRegSizeInBits(RegClass) > 128)
+ VMFMA_used = true;
+ if (TRI.isSGPRClass(&RegClass))
+ SGPR_used = true;
+ }
----------------
linuxrocks123 wrote:
I don't understand what you mean by "AV constraint." I changed it to use those functions, though.
https://github.com/llvm/llvm-project/pull/155491
More information about the llvm-commits
mailing list